Last active
August 31, 2021 08:24
-
-
Save AJamesPhillips/319d9618205a77038eb300a297cbf76f to your computer and use it in GitHub Desktop.
Crypto random password
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; | |
N = 10 | |
''.join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(N)) | |
N = 5 | |
word_file = "/usr/share/dict/words" # only works in *nix, https://stackoverflow.com/a/18835426/539490 | |
WORDS = open(word_file).read().splitlines() | |
''.join(random.SystemRandom().choice(WORDS).capitalize() for _ in range(N)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment