tests/sha256line.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Tue, 26 Mar 2024 08:36:47 +0000
changeset 51544 06671781b04d
parent 51361 fa4c4fa232d6
permissions -rwxr-xr-x
perf-stream-locked-section: actually use v1 generation when requested We were fetching a v1 generator but actually using the v2 function…

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