Created
November 25, 2015 17:01
-
-
Save ravage/71f3b2f558a22a056192 to your computer and use it in GitHub Desktop.
Generate Random Alphanumeric String
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
import random | |
import string | |
def random_string(size=8): | |
rnd = random.SystemRandom() | |
chars = string.ascii_lowercase + string.digits | |
return ''.join(rnd.choice(chars) for i in range(size)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment