Struct rand::reseeding::ReseedingRng
[−]
[src]
pub struct ReseedingRng<R, Rsdr> { pub reseeder: Rsdr, // some fields omitted }
A wrapper around any RNG which reseeds the underlying RNG after it has generated a certain number of random bytes.
Fields
reseeder | Controls the behaviour when reseeding the RNG. |
Methods
impl<R: Rng, Rsdr: Reseeder<R>> ReseedingRng<R, Rsdr>
fn new(rng: R, generation_threshold: u64, reseeder: Rsdr) -> ReseedingRng<R, Rsdr>
Create a new ReseedingRng
with the given parameters.
Arguments
rng
: the random number generator to use.generation_threshold
: the number of bytes of entropy at which to reseed the RNG.reseeder
: the reseeding object to use.
fn reseed_if_necessary(&mut self)
Reseed the internal RNG if the number of bytes that have been generated exceed the threshold.