[][src]Crate randomize

Simple and minimalist randomization library.

NOT FOR CRYPTOGRAPHIC PURPOSES.

Usage

You should make a PCG32 value, and then generally you'll call methods from the Gen32 trait:

use randomize::{Gen32, PCG32};
let mut g = PCG32::seed(5, 6);
println!("rolling 1d6: {}", g.dice(1, 6));

Cargo Features

  • getrandom: adds the from_getrandom method to the PCG32 type, which makes a new generator from OS randomness. This depends on the getrandom crate.

Structs

BoundedRandU32

Stores the values to sample a number in 0 .. N

ExplodingDie

Stores data for an "exploding" 1 through N sided die.

PCG32

A permuted congruential generator with 32 bits of output per step.

StandardDie

Stores data for a standard 1 through N sided die.

Traits

Gen32

For random number generators with a primary output of u32 per use.