๐Ÿ“ฆ astral-sh / rye

๐Ÿ“„ sha256.py ยท 14 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14import hashlib
import sys

h = hashlib.sha256()

with open(sys.argv[1], "rb") as f:
    while True:
        chunk = f.read(4096)
        if not chunk:
            break
        h.update(chunk)

print(h.hexdigest())