tests/sha256line.py
author Arseniy Alekseyev <aalekseyev@janestreet.com>
Tue, 16 Apr 2024 13:51:45 +0100
changeset 51604 32ba01b5669d
parent 51361 fa4c4fa232d6
permissions -rwxr-xr-x
match: share code between includematcher and patternmatcher No need to have this duplication.

#!/usr/bin/env python3
#
# A tool to help producing large and poorly compressible files
#
# Usage:
#   $TESTDIR/seq.py 1000 | $TESTDIR/sha256line.py > my-file.txt


import hashlib
import sys


for line in sys.stdin:
    print(hashlib.sha256(line.encode('utf8')).hexdigest())