nanorand

nanorand is a Rust crate, meant for fast, high-level, zero-dependency random number generation.

Examples

```rs use nanorand::{RNG, WyRand};

fn main() { let mut rng = WyRand::new(); println!("Random 64-bit number: {}", rng.generate::()); } ```

RNG Implementations

RNG|nanorand type|Output Size|Cryptographically Secure|Speed|Notes|Original Implementation :-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----: wyrand|nanohash::WyRand|64 bits (u64)|🚫|4 GB/s||https://github.com/lemire/testingRNG/blob/master/source/wyrand.h Pcg64|nanohash::Pcg64|64 bits (u64)|🚫|1 GB/s||https://github.com/rkern/pcg64 ChaCha|nanohash::ChaCha|512 bits ([u32; 16])|✅|90 MB/s (ChaCha8), 40 MB/s (ChaCha20)|Currently only works in Nightly Rust, will work with Stable 1.47 (see rust#74060)|https://cr.yp.to/chacha.htmightlyl

Entropy Sources

Feature Flags

License

The zlib/libpng License

Copyright (c) 2020 aspen

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

  3. This notice may not be removed or altered from any source distribution.