pub fn randombytes_array<const N: usize>() -> [u8; N]
Expand description

A version of randombytes that returns a fixed-size array instead of a Vec.

Examples

use etebase::utils::randombytes_array;

// Explicitly specifying the length as a type generic
let a = randombytes_array::<5>();

// Letting the length be inferred from the result type
let b: [u8; 10] = randombytes_array();