3 ms·
The first random number generator I learned about was super simple. Middle squares. You take a number, multiply it by itself, and take the middle bits. Because
by Houshalter 11y ago
The first random number generator I learned about was super simple. Middle squares. You take a number, multiply it by itself, and take the middle bits. Because of the way the binary multiplication algorithm works, the bits are pretty thoroughly scrambled and not correlated to the input.
I'm not sure if there aren't clever ways to undo it, but at least it would resist such a simple method like that.
- j2kun 11y agoSounds like Blum-Blum-Shub https://en.wikipedia.org/wiki/Blum_Blum_Shub https://en.wikipedia.org/wiki/Blum_Blum_Shub