RaelB 4 Posted August 16, 2022 I'm wanting to generate a repeatable random number/character sequence based on a given seed value. Using the in built Randomize function with global RandSeed can do this, but is not thread-safe. Any recommendation for open source/light weight solution? Thanks Share this post Link to post
David Heffernan 2354 Posted August 17, 2022 It is utterly trivial to make such a thing using the exact same code as found in Random. You make a record that contains a seed and you add a method that uses that seed to generate the next sample, and then update the seed. If you have specific requirements for the properties of the PRNG then you may find the LCG used by Random doesn't meet them. In which case you'd need to decide what your requirements are. Share this post Link to post