Last active
August 27, 2015 20:35
-
-
Save jamesandariese/e3a32dc5a86650890bce to your computer and use it in GitHub Desktop.
hash file by name
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
def hash_file_by_name(fn): | |
hash = hashlib.sha256() | |
with open(fn) as f: | |
block = f.read(1024*1024) | |
hash.update(block) | |
return hash.hexdigest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment