tests/sha256line.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 21 Feb 2024 11:59:28 +0100
changeset 51415 1df8d84e7c99
parent 51361 fa4c4fa232d6
permissions -rwxr-xr-x
phases: gather the logic for phasesets update in a single method This logic is duplicated around for no good reason, we gather it in a single place. The conditional is the new function are a bit weird as we about going to extend it soon.

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