nimiq-utils 1.4.0

Various utilities (e.g., CRC, Merkle proofs, timers) for Nimiq's Rust implementation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use rand::rngs::OsRng;
pub use rand::{CryptoRng, RngCore};
use rand_core::UnwrapErr;

pub type SecureRng = UnwrapErr<OsRng>;

pub trait SecureGenerate: Sized {
    fn generate<R: RngCore + CryptoRng>(rng: &mut R) -> Self;

    #[inline]
    fn generate_default_csprng() -> Self {
        SecureGenerate::generate(&mut SecureRng::default())
    }
}