#random #randomness #getrandom #compile #returning #data #wraps

possiblyrandom

A crate that wraps getrandom and always compiles, returning 0s when no randomness is available

3 unstable releases

0.2.0 May 9, 2024
0.1.1 Apr 19, 2024
0.1.0 Feb 12, 2024

#6 in #getrandom

Download history 495/week @ 2024-06-21 300/week @ 2024-06-28 442/week @ 2024-07-05 620/week @ 2024-07-12 490/week @ 2024-07-19 424/week @ 2024-07-26 331/week @ 2024-08-02 487/week @ 2024-08-09 474/week @ 2024-08-16 518/week @ 2024-08-23 354/week @ 2024-08-30 141/week @ 2024-09-06 149/week @ 2024-09-13 165/week @ 2024-09-20 126/week @ 2024-09-27 106/week @ 2024-10-04

557 downloads per month
Used in 17 crates (via lightning)

MIT/Apache

4KB

getrandom provides access to OS randomness, but will fail to compile on platforms that do not support fetching OS randomness. This is exactly what you want when you're doing cryptographic operations, but when you're just opportunistically randomizing, we're fine with compiling and simply disabling randomization.

This crate does that, returning only possibly-random data.

Note that this crate only enables getrandom on a subset of platforms it supports. As getrandom evolves this crate is unlikely to carefully track all getrandom-supported platforms, however will use random data on popular platforms.

Dependencies

~125KB