Created
March 15, 2022 02:41
-
-
Save kepstein/ec6e0567685bfa2662f2c5634a432d9f to your computer and use it in GitHub Desktop.
Generating secure random strings
This file contains hidden or 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
#!/usr/bin/env | |
# Python Docs https://docs.python.org/3/library/secrets.html | |
import secrets | |
secrets.token_hex(5).upper() # The number of actual character returned will be double the number in token_hex(n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment