Struct urandom::rng::ChaCha20

source ·
pub struct ChaCha20 { /* private fields */ }
Expand description

Daniel J. Bernstein’s ChaCha20 adapted as a deterministic random number generator.

Examples

let mut rng = urandom::rng::ChaCha20::new();
let value: i32 = rng.next();

Implementations

Creates a new instance seeded securely from system entropy.

See the SeedRng trait for more information.

Creates a new PRNG seeded from another Rng.

See the SeedRng trait for more information.

Creates a new PRNG using the given seed.

See the SeedRng trait for more information.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the next u32 in the sequence.
Returns the next u64 in the sequence.
Fills the next u32 elements in the sequence. Read more
Fills the next u64 elements in the sequence.
Fills the byte slice with uniform random bytes. Read more
Advances the internal state significantly. Read more
Returns a uniform random f32 in the half-open interval [1.0, 2.0). Read more
Returns a uniform random f64 in the half-open interval [1.0, 2.0). Read more
Creates a new instance seeded securely from system entropy. Read more
Creates a new PRNG seeded from another Rng. Read more
Creates a new PRNG using the given seed. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.