Skip to content

Instantly share code, notes, and snippets.



Created Nov 4, 2013
What would you like to do?
class Document(models.Model)
def get_uuid(self):
def bijective_encode(i, start=0):
i += start
CHARS = list('zpYUgh9XWvHbNVK6kmAufqCSeyiBZ7RcLd4GJ5ETMnwPDrx3s8QaF2jt') #randomized to avoid iteration
s = ''
base = len(CHARS)
while i > 0:
s += CHARS[i % base]
i /= base
return s[::-1]
return bijective_encode(, start=int(1e5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.