Skip to content

Instantly share code, notes, and snippets.

@mscalora
Created July 28, 2014 14:14
Show Gist options
  • Save mscalora/d7c09de6394a6ffe60cb to your computer and use it in GitHub Desktop.
Save mscalora/d7c09de6394a6ffe60cb to your computer and use it in GitHub Desktop.
Token generator in python (1,0,o,O,i,I,l,L) eliminated, all 54 other alphanumerics used
#!/usr/bin/env python
import string
import random
tchars = "abcdefghjkmnpqrstuvwxyZABCDEFGHJKMNPQRSTUVWXYZ23456789"
def token(length):
return ''.join(random.choice(tchars) for _ in range(length))
print(token(6))
print(token(8))
print(token(10))
print(token(12))
print(token(14))
print(token(16))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment