noiserand

Crates.ionoiserand
lib.rsnoiserand
version1.0.0
sourcesrc
created_at2021-03-27 22:24:41.720376
updated_at2021-03-27 22:24:41.720376
descriptionRandom white noise turned into random numbers
homepage
repositoryhttps://github.com/badboy/noiserand
max_upload_size
id374433
size44,287
Engine Devs (github:amethyst:engine-devs)

documentation

README

noiserand

Crates.io version docs.rs docs License: MIT

Random white noise turned into random numbers

The ANU QRNG project offers true random numbers to anyone on the internet. By their description:

The random numbers are generated in real-time in our lab by measuring the quantum fluctuations of the vacuum.

The random numbers are offered in a variety of formats, including as five seconds of white noise.

This can be turned back into random bytes and used wherever one need rand::Rng.

Example

use noiserand::NoiseRand;
use rand::Rng;

let mut rng = NoiseRand::new();
let x: u32 = rng.gen();
println!("{}", x);

Listen to randomness.

You can run the included example that turns a stream of random bytes back into noise:

cargo run --example play

Should I really use that?

I mean ... it's guaranteed to be random.

It's also slow. On the first request for random data it will fetch a 5s audio sample from the ANU QRNG project, parse the WAVE file and then use the samples as random numbers. After about 588 kB of random data generated, it sends off another HTTP request to fill the buffer again.

Please don't overload the servers. They do however accept donations, see FAQ: Donating to ANU QRNG.

License

MIT. See LICENSE.

Commit count: 2

cargo fmt