4 ms·
You use a cryptographic hash function. The Linux kernel does something similar for /dev/random: https://en.wikipedia.org/wiki//dev/random https://en.wikipedia.o
by bloak 7y ago
You use a cryptographic hash function. The Linux kernel does something similar for /dev/random: https://en.wikipedia.org/wiki//dev/random https://en.wikipedia.org/wiki//dev/random
If you needed to simulate a single fair coin toss using a biased but at least somewhat random coin you might toss it twenty times, feed the sequence of results ("HTHTT...") into sha256sum, and take the first bit of the output.