Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hashlib
- def md5Checksum(filePath):
- with open(filePath, 'rb') as fh:
- m = hashlib.md5()
- while True:
- data = fh.read(8192)
- if not data:
- break
- m.update(data)
- return m.hexdigest()
- print('The MD5 checksum of text.txt is', md5Checksum('test.txt')
- -------------------------------------------------------
- output:
- The MD5 checksum of text.txt is 098f6bcd4621d373cade4e832627b4f6
- --------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement