Python's random.SystemRandom
provides cryptographic-quality pseudorandom numbers. What platforms is it supported on? Most importantly, are there any platforms that it is not supported on, and if so, which ones? Can anyone provide any information about how portable it is?
From http://docs.python.org/library/random.html
The random module also provides the
SystemRandom
class which uses the system functionos.urandom()
to generate random numbers from sources provided by the operating system.
From http://docs.python.org/library/os.html#os.urandom
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With