Skip to content

Instantly share code, notes, and snippets.

@matthewhudson
Created March 24, 2015 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewhudson/8a3718955b4143c1d7be to your computer and use it in GitHub Desktop.
Save matthewhudson/8a3718955b4143c1d7be to your computer and use it in GitHub Desktop.
access_token.py
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