Crates.io | quantum_random |
lib.rs | quantum_random |
version | 0.1.0 |
source | src |
created_at | 2019-08-06 21:57:07.190491 |
updated_at | 2019-08-06 21:57:07.190491 |
description | This is the rust implementation of the ANU Quantum Random Number System. You can easily generate an arbitrary number of u8's, u16's, u32's, u64's, and u128's |
homepage | https://github.com/tbraun96/quantum_random |
repository | |
max_upload_size | |
id | 154687 |
size | 22,910 |
A fully asynchronous quantum-random generator
Credit goes to qrng.anu.edu.au for the source of quantum-random data
The ANU rng is a nearly perfect random number generator. I take the data and mix it with the rand rng library to help increase entropy in the case that the HTTPS download stream is comprimised remotely; in that case, the data would be modified based on local parameters anyways, and as such, wouldn't matter if the data is comprimised remotely.
The ANU API limits requests to 1024 random numbers at a time per connection*. This program allows you to retrieve more than that (millions even).
use futures::executor::block_on;
use quantum_random::prelude::*;
fn example() {
let number_to_get = 11000;
match block_on(next_u128s(number_to_get)) {
Ok(vals) => {
for val in vals.iter().enumerate() {
println!("[{}]: {}", val.0, val.1);
}
assert_eq!(vals.len(), number_to_get);
},
Err(err) => {
err.printf();
}
}
}
You may view my website here: https://thomaspbraun.com/