Re:Creating randomness Without Math.random
by comex on Sunday July 12, 2020 @10:11PM
(#23816520)
Technically, as long as you only have a finite amount of memory, there is only a finite number of states the computer can be in, so the output must repeat eventually. Though "eventually" can be long after the heat death of the universe.
[ Parent
| on HN ]
We normally ignore that technicality. Like when we say adding two numbers is constant-time, or that a computer can simulate a Turing machine.
True, but in this case, xorshift128+ already maximizes its period by going through every possible state once before repeating. It only has 128 bits of state, but still, the difference between "128 bits" and "all of RAM" is only a constant factor. :) And of course, a period of 2^128 is already more than high enough that it will never repeat in practice.