PyDocs

Nav

Cryptographic Services

token_hex

secrets

function (source)
  • token_hex(nbytes=None)
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'
1 Example
>>> token_hex(16)
'f9bf78b9a18ce6d46a0cd2b0b86df9da'
from the Python docs
See Also
No see-alsos for secrets/token_hex
0 Notes
No notes for token_hex