Advertisement
Guest User

Untitled

a guest
Apr 28th, 2011
3,478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. def Hasher(algorithm, blocksize):
  2.     def hash_file(file):
  3.         hash = algorithm()
  4.         with open(file, 'rb') as f:
  5.             for chunk in iter(lambda: f.read(4096), ''):
  6.                 hash.update(chunk)
  7.         return hash.hexdigest()
  8.     return hash_file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement