2 releases

0.1.1 Nov 29, 2024
0.1.0 Sep 8, 2022

#244 in Operating systems

Download history 3/week @ 2024-09-23 138/week @ 2024-11-25 35/week @ 2024-12-02 22/week @ 2024-12-09

195 downloads per month

BSD-2-Clause OR MIT

12KB
157 lines

License BSD-2-Clause License MIT docs.rs crates.io Download numbers AppVeyor CI dependency status

osrandom

Welcome to osrandom 🎉

A really minimal wrapper around your operating system's cryptographically secure random number generator.

APIs used

The following native APIs are used:

  • macOS/iOS: SecRandomCopyBytes from the built-in Security.framework
  • FreeBSD/OpenBSD/NetBSD: arc4random_buf (which does not use ARC4 anymore but a secure PRF like ChaCha20)
  • Windows: CryptGenRandom with PROV_RSA_FULL as provider
  • Linux-GNU: getrandom for glibc versions >= 2.25 or /dev/urandom for ancient distributions
  • Linux-MUSL: /dev/urandom for ancient distributions

No runtime deps

~0–300KB