pub fn generate_bytes(length: usize) -> Vec<u8> ⓘExpand description
Generates a vector of random bytes of the specified length.
This function returns a Vec<u8> filled with random byte values (u8)
generated using the thread-local random number generator.
§Parameters
length: The number of random bytes to generate.
§Returns
- A
Vec<u8>containinglengthrandom bytes.
§Examples
use regd_testing;
let x = regd_testing::rand::generate_bytes(16);
assert_eq!(x.len(), 16);
println!("Random bytes: {:?}", x);