You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
302 B
Python
9 lines
302 B
Python
2 years ago
|
import hashlib
|
||
|
|
||
|
# from https://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()
|