tests/sha256line.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 06 Mar 2024 16:18:03 +0100
changeset 51535 03247e37ccf7
parent 51361 fa4c4fa232d6
permissions -rwxr-xr-x
branchcache: move the processing of the new data in a dedicated method In a future changeset, this will allow the V3 of the branch cache to use a fast path when possible.

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