Created
February 10, 2016 20:59
-
-
Save joejulian/9f5ff44ff78de0336fa9 to your computer and use it in GitHub Desktop.
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
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