Random Number Generator with Seed
Introduction
The seed key Random seed - also called seed key random seed or start value - is a value with which a random number generator is initialized. The random number generator generates a sequence of random numbers or pseudo-random numbers with the seed as the start value.
If you use the same seed in deterministic random number generators, you get the same sequence of pseudo-random numbers.
For my project trainline I used such a generator which always produces the same sequence of numbers.
Procedure
- Hash your Seed value
- Use an Pseudorandom number generator (PRNG)
Hashing
A good hash function will generate very different results even when two strings are similar. This is very usefull because similar seeds (e.g. a simple seed of 1 and 2) can cause correlations in weaker PRNGs, which leads to the output having similar characteristics.
You can choose between several hash functions.
In this example i used MurmurHash3
PRNG Algorithms (Pseudorandom number generator)
Here is a list of some PRNG or on (wikipedia)[https://en.wikipedia.org/wiki/List_of_random_number_generators]
For my Project is used sfc32.