Skip to content

Instantly share code, notes, and snippets.

@chankeypathak
Created October 17, 2017 05:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chankeypathak/9e7c82f7537e939f9998a0eb82a5cac7 to your computer and use it in GitHub Desktop.
Save chankeypathak/9e7c82f7537e939f9998a0eb82a5cac7 to your computer and use it in GitHub Desktop.
def get_file_md5(f, chunk_size=8192):
h = hashlib.md5()
while True:
chunk = f.read(chunk_size)
if not chunk:
break
h.update(chunk)
return h.hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment