Skip to content

Instantly share code, notes, and snippets.

@d-schmidt
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d-schmidt/9220571 to your computer and use it in GitHub Desktop.
Save d-schmidt/9220571 to your computer and use it in GitHub Desktop.
import random
import __future__
a = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWYXZ23456789$%&()=?+#-}][{*/:<>~' #0Ol1!I
b = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWYXZ23456789'
d = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWYXZ23456789@#%_-&*()'
all = "".join((chr(i) for i in range(33,127)))
def doa(l = 20, chars = a):
return "".join(chars[int(random.random() * (len(chars[:-1])+1))] for i in range(l))
for i in range(4):
print(20-i, ':', doa(20 - i, all))
print(20-i, ':', doa(20 - i, all))
print(20-i, ':', doa(20 - i, all), "\n")
print('username:', doa(10, b), "\n")
print('16 readable:', doa(16, d), "\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment