Files
952-11/env/python/dll/Python312/Lib/__pycache__/secrets.cpython-312.pyc
T

39 lines
2.5 KiB
Plaintext
Raw Normal View History

2024-08-19 17:05:14 +08:00
Ë
*åfãó�—dZgd¢ZddlZddlmZddlmZe«ZejZ ejZ
d„Z dZ d d„Z
d d „Zd d
„Zy) zÑ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/
)ÚchoiceÚ randbelowÚrandbitsÚ SystemRandomÚ token_bytesÚ token_hexÚ
token_urlsafeÚcompare_digestéN)r )rcóL—|dkr td«‚tj|«S)z(Return a random int in the range [0, n).r
zUpper bound must be positive.)Ú
ValueErrorÚ_sysrandÚ
_randbelow)Úexclusive_upper_bounds úCc:\Users\RCi\AppData\Local\Programs\Python\Python312\Lib\secrets.pyrrs(€à Ò!ÜÐ8Ó9Ð9Ü × Ñ Ð4Ó 5Ð5óé có<—|€t}tj|«S)zèReturn a random byte string containing *nbytes* bytes.
If *nbytes* is ``None`` or not supplied, a reasonable
default is used.
>>> token_bytes(16) #doctest:+SKIP
b'\xebr\x17D*t\xae\xd4\xe3S\xb6\xe2\xebP1\x8b'
)ÚDEFAULT_ENTROPYr
Ú randbytes©Únbytess rrr!s€ð€~Ü ˆÜ × Ñ ˜fÓ %Ð%rcó4—t|«j«S)a"Return a random text string, in hexadecimal.
The string has *nbytes* random bytes, each byte converted to two
hex digits. If *nbytes* is ``None`` or not supplied, a reasonable
default is used.
>>> token_hex(16) #doctest:+SKIP
'f9bf78b9a18ce6d46a0cd2b0b86df9da'
)rÚhexrs rrr/s€ô �vÓ × "Ñ "Ó $Ð$rcó~—t|«}tj|«jd«j d«S)zþReturn a random URL-safe text string, in Base64 encoding.
The string has *nbytes* random bytes. If *nbytes* is ``None``
or not supplied, a reasonable default is used.
>>> token_urlsafe(16) #doctest:+SKIP
'Drmhze6EPcv0fN_81Bj-nA'