Last active
August 29, 2015 14:15
-
-
Save imanabu/f8fa0d56b8b031e68eb6 to your computer and use it in GitHub Desktop.
Python Gist
This file contains 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 | |
def hashfile(afile, hasher, blocksize=65536): | |
buf = afile.read(blocksize) | |
while len(buf) > 0: | |
hasher.update(buf) | |
buf = afile.read(blocksize) | |
return hasher.digest() | |
[(fname, hashfile(open(fname, 'rb'), hashlib.sha256())) for fname in fnamelst] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment