Crates.io | sungod |
lib.rs | sungod |
version | 0.3.1 |
source | src |
created_at | 2021-03-30 21:06:56.736309 |
updated_at | 2021-04-07 17:02:04.196666 |
description | 0-Dependency random numbers to brighten your day |
homepage | |
repository | https://github.com/FredTheDino/sungod |
max_upload_size | |
id | 375922 |
size | 10,078 |
A simple and super slim random crate, gifted from the sun God!
If you need decent random numbers pretty speedily, and hate to wait for compile-times, this is the crate for you! No dependencies, no worries!
A basic usage would look like this:
use sungod::Ra;
fn main() {
let mut ra = Ra::default();
assert_ne!(ra.sample::<u64>(), ra.sample::<u64>());
}
If you want to run in no_std-environments you need to build without default features. E.g., in your Cargo.toml:
sungod = { version = "x.y", default-features = false }
This is an implementation of xorwow, in a nice slim package, with some extra type safety. If you want to support randomizing more exotic types, you'll have to implement it yourself. No fancy traits or anything in this crate.
NOTE: This create is not at all suitable for cryptographic use.