get-random-const

Crates.io Documentation

Macro to generate random at compile time

```rust use getrandomconst::random;

const RANDOMU8: u8 = random!(u8); assertne!(RANDOM_U8, 0);

static RANDOMI32: i32 = random!(i32); assertne!(RANDOM_I32, 0);

let randomu32 = random!(u32); assertne!(random_u32, 0);

let randomarray = random!([u32;5]); asserteq!(random_array.len(), 5);

for elem in randomarray.iter() { assertne!(*elem, 0); }

let randomarray: [u32; 0] = random!([u32;0]); //Well, I guess you can if you want? asserteq!(random_array.len(), 0); ```