spinoso_random

Function new_seed

Source
pub fn new_seed() -> Result<[u32; 4], NewSeedError>
Expand description

Read a new Random seed, using platform-provided randomness.

§Examples

use spinoso_random::{Error, Random};

let seed = spinoso_random::new_seed()?;
example().unwrap();

§Errors

If the randomness feature provided by the platform is not present or failed to completely generate a seed, an error is returned. This error should be raised as a Ruby RuntimeError.