Last active
June 16, 2016 17:57
-
-
Save dniku/24e734a5ece3289ab0e2326808b0da05 to your computer and use it in GitHub Desktop.
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 os, hashlib | |
data = [] | |
for fname in sorted(os.listdir('.')): | |
if os.path.isfile(fname): | |
with open(fname, 'rb') as f: | |
contents = f.read() | |
data.append((fname, hashlib.sha1(contents).hexdigest())) | |
with open('hashes.txt', 'w') as f: | |
for fname, sha1 in data: | |
f.write('%s %s\n' % (sha1, fname)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment