https://github.com/kizzycode/osrandom-rust
This crate provides access to your operating system's cryptographically secure random number generator
https://github.com/kizzycode/osrandom-rust
Last synced: 29 days ago
JSON representation
This crate provides access to your operating system's cryptographically secure random number generator
- Host: GitHub
- URL: https://github.com/kizzycode/osrandom-rust
- Owner: KizzyCode
- Created: 2022-09-08T17:33:31.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-29T22:14:16.000Z (6 months ago)
- Last Synced: 2025-03-29T20:23:30.431Z (about 2 months ago)
- Language: Rust
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE BSD 2-CLAUSE.md
Awesome Lists containing this project
README
[](https://opensource.org/licenses/BSD-2-Clause)
[](https://opensource.org/licenses/MIT)
[](https://docs.rs/osrandom)
[](https://crates.io/crates/crypto_api_osrandom)
[](https://crates.io/crates/osrandom)
[](https://ci.appveyor.com/project/KizzyCode/osrandom-rust)
[](https://deps.rs/crate/osrandom)# 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](https://cr.yp.to/chacha.html))
- 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