Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # this is from The Python
- # Standard Library by example
- # ISBN13: 9780321767349
- import base64
- import hmac
- import hashlib
- with open('lorem.txt', 'rb') as f:
- body = f.read()
- hash = hmac.new('secret-key', body, hashlib.sha1)
- digest = hash.digest()
- print base64.encodestring(digest)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement