Algorithm to generate insecure random numbers

48 Views Asked by At

I would like an algorithm which can generate a list of random, uniformly distributed floating point numbers from a given seed, ideally also being able to specify the number of decimal places.

The use case if for randomly generating datasets for education, so does not need to be secure. What would a good algorithm be for this? Ideally one that is easy to understand and easy to write in a programming language.

1

There are 1 best solutions below

0
On BEST ANSWER

Use a LCG https://en.wikipedia.org/wiki/Linear_congruential_generator to generate a uniform integer and rescale it as you wish.