Usually it’s done using a Pseudo Random Number Generator (PRNG). This algorithm takes a number as input and outputs another seemingly unrelated and usually irreversible number.
However, this algorithm isn’t inherently random, as the same input will always produce the same output, so you need to start the algorithm with a number you trust to be random enough (called a seed) such as the current time with millisecond precision, the current temperature of the CPU, camera noise, the position of the mouse cursor or a combination of all of those.
Then, the previous result of the PRNG is fed back into it, generating a sequence of numbers that looks completely random.
Latest Answers