Created
December 6, 2022 18:58
-
-
Save detrout/4db9b2647d2b2bb23ce5124bf03fb533 to your computer and use it in GitHub Desktop.
Example of generating md5sums.
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 make_python_md5sum(filename): | |
with open(filename, "rb") as instream: | |
md5 = hashlib.md5() | |
# for large files this might need to be a loop reading in | |
# chunks. md5.update will work correctly when being given blocks | |
block = instream.read() | |
md5.update(block) | |
return md5.hexdigest() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment