Created
October 17, 2017 05:50
-
-
Save chankeypathak/9e7c82f7537e939f9998a0eb82a5cac7 to your computer and use it in GitHub Desktop.
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
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