Paste number 8813: DNS ID Thing

Paste number 8813: DNS ID Thing
Pasted by: sbp
When:6 years, 11 months ago
Share:Tweet this! | http://paste.lisp.org/+6ST
Channel:#swhack
Paste contents:
Raw Source | XML | Display As
>>> import sha
>>> from base64 import b32encode
>>> def dnsid(email): 
...    hash = sha.new(email).digest()
...    return b32encode(hash[:10]).lower().rstrip('=\n')
... 
>>> print dnsid('name@example.org')
et7jalakqf4zlg2o
>>> 

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.