#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

#190 in #wasi

Download history 33/week @ 2024-11-15 50/week @ 2024-11-22 136/week @ 2024-11-29 30/week @ 2024-12-06 56/week @ 2024-12-13 18/week @ 2024-12-20 27/week @ 2024-12-27 36/week @ 2025-01-03 69/week @ 2025-01-10 45/week @ 2025-01-17 46/week @ 2025-01-24 41/week @ 2025-01-31 96/week @ 2025-02-07 10/week @ 2025-02-14 11/week @ 2025-02-21 41/week @ 2025-02-28

164 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