3 from base64 import urlsafe_b64encode
4 from hashlib import sha1
8 sha_digest = sha1(('%d%s' % (time.time(), str(seed))
9 ).encode('utf-8', 'replace')).digest()
10 return urlsafe_b64encode(sha_digest).decode('latin1').replace('=', '').replace('_', '-').lower()