Last active
December 20, 2015 02:09
-
-
Save 0atman/6054206 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from hashlib import sha1 | |
import uuid | |
import hmac | |
def generate_key(self): | |
""" | |
Lifted from: | |
https://github.com/toastdriven/django-tastypie/blob/master/tastypie/models.py#L46 | |
""" | |
return hmac.new(str(uuid.uuid4()), digestmod=sha1).hexdigest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment