HydroRandom
This module contains functions for the creation of random numbers and handling of the random number generator.
Example:
(HydroRandom.uniform 10)
buf-deterministic
defn
(Fn [Int, (Ref (Array Byte) a)] (Array Byte))
(buf-deterministic len seed)
creates a buffer containing len
numbers
indistinguishable from random bytes without knowing seed
. For a given seed,
this function will always output the same sequence. This function is mainly
useful for writing tests.
ratchet
external
(Fn [] ())
erases part of the RNG state to make recovering previous RNG states impossible.
uniform
external
(Fn [Int] Int)
creates a uniform random number from 0 to an upper limit provided as argument.