osrandom

Crates.ioosrandom
lib.rsosrandom
version0.1.1
sourcesrc
created_at2022-09-08 17:58:51.544727
updated_at2024-11-29 22:09:33.280066
descriptionAn interface to the OS' secure random number generator
homepage
repositoryhttps://github.com/KizzyCode/osrandom-rust
max_upload_size
id661202
size19,872
Keziah Biermann (KizzyCode)

documentation

README

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
Commit count: 4

cargo fmt