Skip to content

Instantly share code, notes, and snippets.

@kepstein
Created March 15, 2022 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kepstein/ec6e0567685bfa2662f2c5634a432d9f to your computer and use it in GitHub Desktop.
Save kepstein/ec6e0567685bfa2662f2c5634a432d9f to your computer and use it in GitHub Desktop.
Generating secure random strings
#!/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