Crate randomize

Source
Expand description

Pseudo-random number generator crate.

NOT FOR CRYPTOGRAPHIC PURPOSES.

§Using This Crate

  • Create a PCG32 or PCG32K value as your generator.
    • If you enable this crate’s getrandom cargo feature then both types will have constructor functions to handle seeding a generator from the getrandom function.
  • Call next_u32 on the generator to get pseudo-random u32 values.
  • At your option, import the Gen32 trait for various extension methods.

Modules§

formulas
Base formulas used elsewhere in the crate.

Structs§

BoundedRandU16
Allows sampling a u16 number in 0 .. N.
BoundedRandU32
Allows sampling a u32 number in 0 .. N.
PCG32
A Permuted Congruential Generator with 32-bit output.
PCG32K
A Permuted Congruential Generator with 32-bit output, extended to K dimensions.

Traits§

Gen32
A trait for pseudo-random number generators with 32-bit output per step.