#random #wasi #numbers #rng-core

no-std wasi-rng

An random number generator implementation for WASI

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

#216 in #wasi

Download history 7/week @ 2025-10-13 4/week @ 2025-10-20 108/week @ 2025-11-10 13/week @ 2025-11-17 13/week @ 2025-12-01 9/week @ 2025-12-08 63/week @ 2025-12-15

96 downloads per month

MIT license

3KB

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());

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

Dependencies

~58KB