iwlink 0.1.1

IntelliWallet Link - encrypted phone to computer protocol for IntelliWallet for Browser
Documentation
1
2
3
4
5
6
7
8
9
10
//! Randomness from the operating system.

use crate::error::{LinkError, Result};

/// Fill `N` bytes from the operating system's generator.
pub(crate) fn bytes<const N: usize>() -> Result<[u8; N]> {
    let mut out = [0u8; N];
    getrandom::fill(&mut out).map_err(|_| LinkError::Random)?;
    Ok(out)
}