3 from base64 import urlsafe_b64encode
4 from django.utils.hashcompat import sha_constructor
8 sha_digest = sha_constructor('%s%s' %
9 (time.time(), unicode(seed).encode('utf-8', 'replace'))).digest()
10 return urlsafe_b64encode(sha_digest).replace('=', '').replace('_', '-').lower()