blob: 5d48c15a788e62d5147d64bf1282aae950b1d1ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#!/usr/bin/env python2
"""
Computes a SHA256 sum of a file.
Accepts a file path, prints the hex encoded hash to stdout.
"""
import sys
from hashlib import sha256
with open(sys.argv[1], 'rb') as f:
print(sha256(f.read()).hexdigest())
|