4 releases
0.1.3 | Dec 26, 2019 |
---|---|
0.1.2 | Dec 8, 2019 |
0.1.1 | Dec 8, 2019 |
0.1.0 | Dec 8, 2019 |
#169 in #wasi
109 downloads per month
3KB
wasi-rng
A super simple implementation of a Random Number Generator for WASI.
Implements RngCore
and CryptoRng
by using random_get
to
try_fill_bytes
.
use rand_core::RngCore;
use wasi_rng::WasiRng;
let mut rng = WasiRng;
println!("random number: {}", rng.next_u32());
License: MIT
lib.rs
:
A super simple implementation of a Random Number Generator for WASI. Implements [RngCore] and [CryptoRng] by using [random_get] to try_fill_bytes.
use rand_core::RngCore;
use wasi_rng::WasiRng;
let mut rng = WasiRng;
println!("random number: {}", rng.next_u32());
Dependencies
~1MB
~15K SLoC