Module random

Source
Expand description

Generate random numbers.

§Getting Started

use cala::{
    log::{log, Tag},
    random::{Rng, WyRand},
};

const INFO: Tag = Tag::new("Info");

let mut rng = WyRand::new();
log!(INFO, "Random number between 1 and 100: {}", rng.generate_range::<u64>(1, 100));

Structs§

ChaCha
An instance of the ChaCha random number generator. Seeded from the system entropy generator when available. This generator is theoretically cryptographically secure.
Pcg64
An instance of the Pcg64 random number generator. Seeded from the system entropy generator when available. This generator is NOT cryptographically secure.
WyRand
An instance of the WyRand random number generator. Seeded from the system entropy generator when available. This generator is NOT cryptographically secure. #[repr(transparent)]

Traits§

Rng
A trait that represents a random number generator.