Skip to content

Instantly share code, notes, and snippets.

@joejulian
Created February 10, 2016 20:59
Show Gist options
  • Save joejulian/9f5ff44ff78de0336fa9 to your computer and use it in GitHub Desktop.
Save joejulian/9f5ff44ff78de0336fa9 to your computer and use it in GitHub Desktop.
def char8(uuid):
allowed = 'abcdefghijkmnopqrstuvwxyz1234567890' * 5
b = ""
a = uuid.hex
while a:
b += allowed[int(a[:2],16) & 0xaf]
a = a[4:]
return b
# >>> char8(uuid.uuid4())
# 'b9zi3n8z'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment