Python secrets.token_bytes() Function
The secrets.token_bytes() function generates secure random bytes.
Useful for generating encryption keys, salts, and other binary tokens.
Syntax
secrets.token_bytes(nbytes=None)
Return Value
A bytes object containing random bytes.
Example
Output
Click Run to execute your code