Created
October 7, 2015 14:53
-
-
Save wynemo/db87fe52201c67277e90 to your computer and use it in GitHub Desktop.
python my-sha256.py your_file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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