#wasi #numbers #generator #crypto-rng #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

#177 in #wasi

Download history 103/week @ 2024-07-22 43/week @ 2024-07-29 26/week @ 2024-08-12 36/week @ 2024-08-19 13/week @ 2024-08-26 2/week @ 2024-09-16 43/week @ 2024-09-23 26/week @ 2024-09-30 38/week @ 2024-10-07 2/week @ 2024-10-14 8/week @ 2024-10-21 82/week @ 2024-11-04

92 downloads per month

MIT license

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
~16K SLoC