Created
March 24, 2015 15:46
-
-
Save matthewhudson/8a3718955b4143c1d7be to your computer and use it in GitHub Desktop.
access_token.py
This file contains hidden or 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
import uuid | |
import hashlib | |
import base64 | |
def generate_unique_id(): | |
return base64.b32encode( | |
hashlib.sha256(uuid.uuid4().bytes).digest())[:12].lower() | |
def generate_access_token(): | |
return base64.b32encode(hashlib.sha256(uuid.uuid4().bytes).digest())[:52] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment