Last active
April 20, 2017 16:33
-
-
Save igorzakhar/e17369f84b1a5bafb6e4c3eb4a87e89c to your computer and use it in GitHub Desktop.
MD5 checksum of a file
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
#from http://stackoverflow.com/questions/3431825/generating-an-md5-checksum-of-a-file | |
def md5(fname): | |
hash_md5 = hashlib.md5() | |
with open(fname, "rb") as f: | |
for chunk in iter(lambda: f.read(4096), b""): | |
hash_md5.update(chunk) | |
return hash_md5.hexdigest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment