passkey-types 0.5.0

Rust type definitions for the webauthn and CTAP specifications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Random number generator utilities used for tests

use rand::RngCore;

fn random_fill(buffer: &mut [u8]) {
    let mut random = rand::thread_rng();
    random.fill_bytes(buffer);
}

/// Generate random data of specific length.
pub fn random_vec(len: usize) -> Vec<u8> {
    let mut data = vec![0u8; len];
    random_fill(&mut data);
    data
}