#numbers #quantum #anu #u128 #u64 #u16 #data

nightly quantum_random

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

1 unstable release

0.1.0 Aug 6, 2019

#17 in #u128

AGPL-3.0-only

22KB
405 lines

quantum_random

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/

Dependencies

~23MB
~489K SLoC