Skip to content

Instantly share code, notes, and snippets.

@neotheicebird
Created August 22, 2014 13:46
Show Gist options
  • Save neotheicebird/f3ae02bfefeffb064f9b to your computer and use it in GitHub Desktop.
Save neotheicebird/f3ae02bfefeffb064f9b to your computer and use it in GitHub Desktop.
MD5 checksum function
# source http://joelverhagen.com/blog/2011/02/md5-hash-of-file-in-python/
import hashlib
def md5Checksum(filePath):
with open(filePath, 'rb') as fh:
m = hashlib.md5()
while True:
data = fh.read(8192)
if not data:
break
m.update(data)
return m.hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment