Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f = open(fileName)
- while not endOfFile:
- f.read(128)
- def md5_for_file(f, block_size=2**20):
- md5 = hashlib.md5()
- while True:
- data = f.read(block_size)
- if not data:
- break
- md5.update(data)
- return md5.digest()
- import hashlib
- md5 = hashlib.md5()
- with open('myfile.txt','rb') as f:
- for chunk in iter(lambda: f.read(8192), ''):
- md5.update(chunk)
- return md5.digest()
Add Comment
Please, Sign In to add comment