Skip to main content

rand_bytes

Macro rand_bytes 

Source
macro_rules! rand_bytes {
    ($rng:expr, $len:expr) => { ... };
}
Expand description

Returns a Vec<u8> of len random bytes. Requires the alloc feature.

ยงExamples

use vrd::{Random, rand_bytes};

let mut rng = Random::from_u64_seed(42);
let bytes = rand_bytes!(rng, 16);
assert_eq!(bytes.len(), 16);