mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Update secrets from 3.13.5 (#5991)
This commit is contained in:
5
Lib/secrets.py
vendored
5
Lib/secrets.py
vendored
@@ -2,7 +2,7 @@
|
||||
managing secrets such as account authentication, tokens, and similar.
|
||||
|
||||
See PEP 506 for more information.
|
||||
https://www.python.org/dev/peps/pep-0506/
|
||||
https://peps.python.org/pep-0506/
|
||||
|
||||
"""
|
||||
|
||||
@@ -13,7 +13,6 @@ __all__ = ['choice', 'randbelow', 'randbits', 'SystemRandom',
|
||||
|
||||
|
||||
import base64
|
||||
import binascii
|
||||
|
||||
from hmac import compare_digest
|
||||
from random import SystemRandom
|
||||
@@ -56,7 +55,7 @@ def token_hex(nbytes=None):
|
||||
'f9bf78b9a18ce6d46a0cd2b0b86df9da'
|
||||
|
||||
"""
|
||||
return binascii.hexlify(token_bytes(nbytes)).decode('ascii')
|
||||
return token_bytes(nbytes).hex()
|
||||
|
||||
def token_urlsafe(nbytes=None):
|
||||
"""Return a random URL-safe text string, in Base64 encoding.
|
||||
|
||||
Reference in New Issue
Block a user