I have a function that uses Randomized numbers to generate its output. I'd like to be able to seed these random numbers with a long string; so long as the string is the same, the random number sequence will be the same. This is mainly for test purposes, but also for repeatability.
I plan on creating a wrapper class that acts like the built-in System.Random class with a constructor sort of like this:
MyRandom mr = new MyRandom(100, "This is a really long string...");
This generates an internal list of numbers so that when mr.Next() is called it just returns the next entry in the list. When it gets to 100, the list just wraps. I'd like to be able to call .NextDouble() too. This isn't meant to be anything high performance, I just want to be able to generate a random list and use it again.
How do I convert the long string into a list of randomish number. I've thought about taking the length of the string and diving by the number n (in this case 100). Then subdividing the string and calling a hash on each segment.
Is this a reasonable way to do this or is there another, better method?