tests/sha256line.py
author Matt Harbison <matt_harbison@yahoo.com>
Wed, 10 Jul 2024 17:55:14 -0400
changeset 51675 bc94cbb49b30
parent 51361 fa4c4fa232d6
permissions -rwxr-xr-x
typing: add some trivial type hints to `mercurial/match.py` These were new methods since hg 3dbc7b1ecaba, but surprisingly pytype couldn't figure them out.

#!/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())