Skip to content

Instantly share code, notes, and snippets.

@asciipip
Created August 19, 2014 01:16
Show Gist options
  • Save asciipip/794868de6a174e64dcda to your computer and use it in GitHub Desktop.
Save asciipip/794868de6a174e64dcda to your computer and use it in GitHub Desktop.
#!/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