Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hashlib
- import base64
- def file_hash(filename):
- h = hashlib.sha1()
- with open(filename, 'rb', buffering=0) as f:
- for b in iter(lambda : f.read(128*1024), b''):
- h.update(b)
- return h.digest()
- if __name__=='__main__':
- digest = file_hash("filename")
- print base64.b32encode(digest).lower()
Add Comment
Please, Sign In to add comment