Expand description
Random number generation.
This module defines several types:
- RNG algorithms specialized for 8-bit devices:
Xabc
,Xyza8a
,Xyza8b
. - Classic XorShift algorithms and variations with a smaller state.
The RNGs implement Copy
for convenience and versatility.
Be careful to not duplicate the state by accident.
The Default
implementation uses a fixed seed for convenience.
Use a custom seed for unique random sequences.
§Features
All PRNGs require the
rand
feature, except for XorShift128p
, which is always compiled.
Macros§
- xorshift_
custom rand
- Constructs a XorShift prng with custom bits, basis, triplet and seed.
Structs§
- Lgc16
rand
- A 16-bit LCG PRNG.
- Xabc
rand
- X ABC PRNG for 8-bit devices.
- XorShift8
rand
- The
XorShift8
PRNG. - XorShift16
rand
- The
XorShift16
PRNG. - XorShift32
rand
- The
XorShift32
PRNG. - XorShift64
rand
- The
XorShift64
PRNG. - XorShift128
rand
- The
XorShift128
PRNG. - XorShift128p
- The
XorShift128+
PRNG. - Xoroshiro128pp
rand
- The
Xoroshiro128++
PRNG. - Xyza8a
rand
- A simple 8-bit PRNG with 32-bit of state, based on the XorShift algorithm.
- Xyza8b
rand
- A simple 8-bit PRNG with 32-bit of state, based on the XorShift algorithm.