Staging: this is not the live site, pydocs.org.
secrets Generate cryptographically strong pseudo-random numbers suitable for
managing secrets such as account authentication, tokens, and similar.
See PEP 506 for more information.
https://peps.python.org/pep-0506/ © Python Software Foundation. PSF License Version 2 · Official docs ↗
Symbols in secrets c choice Choose a random element from a non-empty sequence. d DEFAULT_ENTROPY Default number of bytes of randomness used by the token_* functions. r randbelow Return a random int in the range [0, n). s SystemRandom Alternate random number generator using sources provided by the operating system (such as /dev/urandom on Unix or CryptGenRandom on Windows). t token_bytes Return a random byte string containing *nbytes* bytes. token_hex Return a random text string, in hexadecimal. token_urlsafe Return a random URL-safe text string, in Base64 encoding.
Python docs © Python Software Foundation · Examples CC0 ·
Source on GitHub · Not affiliated with the PSF