Full name
random.randbytes
Library
random
Syntax
random.randbytes(n)
Description
The random.randbytes function generates random bytes.
Parameters
- n: Number of bytes to generate.
Result
The random.randbytes function returns a value of type bytes .
Examples
We can generate three random bytes with the following code:
random.randbytes(3)
b '\x17bu'