Skip to content

Instantly share code, notes, and snippets.

@wynemo
Created October 7, 2015 14:53
Show Gist options
  • Save wynemo/db87fe52201c67277e90 to your computer and use it in GitHub Desktop.
Save wynemo/db87fe52201c67277e90 to your computer and use it in GitHub Desktop.
python my-sha256.py your_file
import hashlib
import sys
h = hashlib.sha256()
f = sys.argv[1]
with open(f, 'rb') as f:
while 1:
s = f.read(64*1024)
if not s:
break
h.update(s)
print h.hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment