Next: random utils, Previous: random mrg32k3a, Up: random [Index]
In Unix–like operating systems, /dev/random is a special file that serves as a true random number generator or as a pseudorandom number generator. It allows access to environmental noise collected from device drivers and other sources. Not all operating systems implement the same semantics for /dev/random14.
Create and return a new randomness source using the specified device to generate random integers in the range [0, 2^{32}). When device is not specified, it defaults to /dev/urandom.
We have to remember that reading /dev/random will block if not enough entropy is available, waiting for more randomness to be provided by the system. This is why, by default, this function will use /dev/urandom, which never blocks but provides randomness of lesser quality.
The state returned by random-source-state-ref
is a Scheme vector
of length 7, whose first value is the symbol
random-source-state/device
. The other values are the device
pathname, a cache vector of values, the index of the next value to be
extracted from the cace vector.
Device–based randomness sources cache read bytes into a bytevector of fixed size. This parameter allows us to select the size at source construction time. It is preset to 4096.
Read number-of-bytes from the specified device on the file
system and return them in a newly allocated bytevector.
random-bytevector
is a specialised version reading bytes from
/dev/random. urandom-bytevector
is a specialised version
reading bytes from /dev/urandom.
Fill the bytevector bv with bytes read from the specified
device on the file system; return bv itself.
random-bytevector!
is a specialised version reading bytes from
/dev/random. urandom-bytevector!
is a specialised version
reading bytes from /dev/urandom.
Next: random utils, Previous: random mrg32k3a, Up: random [Index]