#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

#169 in #wasi

Download history 9/week @ 2024-03-14 18/week @ 2024-03-21 81/week @ 2024-03-28 46/week @ 2024-04-04 53/week @ 2024-04-11 20/week @ 2024-04-18 23/week @ 2024-04-25 23/week @ 2024-05-02 7/week @ 2024-05-09 23/week @ 2024-05-16 19/week @ 2024-05-23 38/week @ 2024-05-30 7/week @ 2024-06-06 59/week @ 2024-06-13 19/week @ 2024-06-20 24/week @ 2024-06-27

109 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
~15K SLoC