techielokesh-tl / lucky-numbers

1 stars 1 forks source link

Use a source of true random numbers #1

Open gafter opened 3 months ago

gafter commented 3 months ago

Rather than using C++'s default, deterministic random number generator, we should one that uses a source of quantum noise. Most modern processors have instructions for fetching true random data, and I suspect the C++ standard library provides access to that.

gafter commented 3 months ago

See https://en.cppreference.com/w/cpp/numeric/random/random_device

gafter commented 3 months ago

See also

Of course, you don't need to know these things to use the C++ library, but in case you were wondering how the library works, see these instructions. There are some interesting papers about how the instructions are implemented if you want to learn more.