#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

#8 in #getrandom

Download history 596/week @ 2024-07-21 252/week @ 2024-07-28 434/week @ 2024-08-04 436/week @ 2024-08-11 424/week @ 2024-08-18 530/week @ 2024-08-25 334/week @ 2024-09-01 138/week @ 2024-09-08 141/week @ 2024-09-15 148/week @ 2024-09-22 126/week @ 2024-09-29 117/week @ 2024-10-06 132/week @ 2024-10-13 198/week @ 2024-10-20 138/week @ 2024-10-27 137/week @ 2024-11-03

618 downloads per month
Used in 18 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

~130KB