Last active
January 26, 2018 05:34
-
-
Save zgzhong/cf907a19e953ba3822dbd3290a90565f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from hashlib import md5 | |
| # this function calculate the md5 value of the file | |
| def md5sum(fname): | |
| with open(fname, 'rb') as f: | |
| m = md5() | |
| while True: | |
| d = f.read(8192) | |
| if not d: | |
| break | |
| m.update(d) | |
| return m.hexdigest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment