This function returns random bytes from an OS-specific randomness source. The returned data should be unpredictable enough for cryptographic applications, though its exact quality depends on the OS implementation. On a UNIX-like system this will query
/dev/urandom
, and on Windows it will useCryptGenRandom()
. If a randomness source is not found,NotImplementedError
will be raised.For an easy-to-use interface to the random number generator provided by your platform, please see
random.SystemRandom
.
[Source]