forked from Rust-related/RustPython
Update secrets from CPython 3.10.6
This commit is contained in:
committed by
Jeong YunWon
parent
19504a6b9d
commit
b6523ddb90
3
Lib/secrets.py
vendored
3
Lib/secrets.py
vendored
@@ -14,7 +14,6 @@ __all__ = ['choice', 'randbelow', 'randbits', 'SystemRandom',
|
||||
|
||||
import base64
|
||||
import binascii
|
||||
import os
|
||||
|
||||
from hmac import compare_digest
|
||||
from random import SystemRandom
|
||||
@@ -44,7 +43,7 @@ def token_bytes(nbytes=None):
|
||||
"""
|
||||
if nbytes is None:
|
||||
nbytes = DEFAULT_ENTROPY
|
||||
return os.urandom(nbytes)
|
||||
return _sysrand.randbytes(nbytes)
|
||||
|
||||
def token_hex(nbytes=None):
|
||||
"""Return a random text string, in hexadecimal.
|
||||
|
||||
Reference in New Issue
Block a user