tests/sha256line.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 06 Mar 2024 11:39:44 +0100
changeset 51529 4141d12de073
parent 51361 fa4c4fa232d6
permissions -rwxr-xr-x
branchcache: store filtered hash and obsolete hash independently for V3 This will avoid the bug covered in tests/test-branches-obsolete.t when we stop storing all heads explicitly in V3.

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