PyDocs

Nav

Cryptographic Services

token_bytes

secrets

function (source)
  • token_bytes(nbytes=None)
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'
1 Example
>>> token_bytes(16)
b'\xebr\x17D*t\xae\xd4\xe3S\xb6\xe2\xebP1\x8b'
from the Python docs
See Also
No see-alsos for secrets/token_bytes
0 Notes
No notes for token_bytes