We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0a6f73 commit 04407beCopy full SHA for 04407be
Lib/secrets.py
@@ -2,7 +2,7 @@
2
managing secrets such as account authentication, tokens, and similar.
3
4
See PEP 506 for more information.
5
-https://www.python.org/dev/peps/pep-0506/
+https://peps.python.org/pep-0506/
6
7
"""
8
@@ -13,7 +13,6 @@
13
14
15
import base64
16
-import binascii
17
18
from hmac import compare_digest
19
from random import SystemRandom
@@ -56,7 +55,7 @@ def token_hex(nbytes=None):
56
55
'f9bf78b9a18ce6d46a0cd2b0b86df9da'
57
58
59
- return binascii.hexlify(token_bytes(nbytes)).decode('ascii')
+ return token_bytes(nbytes).hex()
60
61
def token_urlsafe(nbytes=None):
62
"""Return a random URL-safe text string, in Base64 encoding.
0 commit comments