Skip to content

Instantly share code, notes, and snippets.

@xebecnan
Created December 17, 2014 07:08
Show Gist options
  • Save xebecnan/9300d29a51c614b0aea6 to your computer and use it in GitHub Desktop.
Save xebecnan/9300d29a51c614b0aea6 to your computer and use it in GitHub Desktop.
import hashlib
def get_file_md5(filename):
md5 = hashlib.md5()
with open(filename,'rb') as f:
for chunk in iter(lambda: f.read(128*md5.block_size), b''):
md5.update(chunk)
return md5.hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment