Last active
August 29, 2015 14:03
-
-
Save neotheicebird/71886119d9b2c8302643 to your computer and use it in GitHub Desktop.
Random string generation
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
# fastest, but complex | |
'%030x' % random.randrange(16**30) | |
# fast | |
binascii.b2a_hex(os.urandom(15)) | |
# beautiful | |
''.join(random.choice(string.hexdigits) for n in xrange(30)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment