Crate acorn_prng
source ·Expand description
ACORN Pseudo-random Number Generator
This pseudo-random number generator is based on the ACORN algorithm.
It is a #![no_std]
crate that does not require alloc and
has no dependencies.
The numbers generated from this prng are not considered cryptographically secure.
Usage
Create a generator by specifying both the Order and the Seed.
Allowing the user of this library to specify the starting data makes reproducability possible.
If you do not require reproducable pseudo-random numbers then using the current time converted into
a u128
for the Seed should provide
sufficient randomness.
Then you can generate either a number of a fixed digit length or a number bewteen a specified range (inclusive).
Please see the Acorn struct documentation for examples.
Structs
- Additive Congruential Random Number (ACORN) generator.
- The order used for the ACORN algorithm.
- The seed used for the ACORN algorithm.