elpekenin/rng.h

Generate (pseudo-)random numbers.

Note

This is just a convenience layer on top of lib8tion.h


void rng_set_seed(uint16_t seed)
[source]

Set the seed for the RNG.

Tip

I do it by reading ADC’s noise twice and multiplying the values.

uint16_t rng_min_max(uint16_t min, uint16_t max)
[source]

Generate a random number in the [min, max] range.

It will also add some entropy to the RNG.