Created
August 19, 2014 01:16
-
-
Save asciipip/794868de6a174e64dcda to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/python | |
import random | |
import string | |
UNAMBIGUOUS_LETTERS = list(set(string.ascii_lowercase) - set('ilou')) | |
def randid(): | |
"""Creates a random ID space with three modified | |
base32 characters and one number in random order for | |
example vnt5, z2aa, tb9h or 2qxd""" | |
e = [ random.choice(UNAMBIGUOUS_LETTERS) for i in xrange(3) ] + \ | |
[ random.choice(string.digits) for i in xrange(1) ] | |
random.shuffle(e) | |
return ''.join(e) | |
if __name__ == '__main__': | |
# Prints ten examples of the same | |
for n in xrange(10): | |
print randid() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment