Created
January 13, 2012 12:40
-
-
Save eserge/1605923 to your computer and use it in GitHub Desktop.
simple random string generator
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
def random_string(length): | |
'''visually similar characters were deliberately removed''' | |
import random | |
letters = u"346789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY" | |
return "".join([letters[random.randint(0,len(letters)-1)] for i in range(length)]) | |
if __name__ == "__main__": | |
for i in range(10): | |
print random_string(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment