[][src]Trait kernel::hil::rng::Random

pub trait Random<'a> {
    fn initialize(&'a self);
fn reseed(&self, seed: u32);
fn random(&self) -> u32; }

Generic interface for a synchronous 32-bit random number generator.

Required methods

fn initialize(&'a self)

Initialize/reseed the random number generator from an internal source. This initialization MAY be deterministic (e.g., based on an EUI-64) or MAY be random (e.g., based on an underlying hardware entropy source); an implementation SHOULD make reseeding random.

fn reseed(&self, seed: u32)

Reseed the random number generator with a specific seed. Useful for deterministic tests.

fn random(&self) -> u32

Generate a 32-bit random number.

Loading content...

Implementors

Loading content...