That is precisely how pseudo random number generators (PRNGs) work. When seeded the same way, they yield the same sequence of pseudo random numbers.
Take a look at the documentation for the constructor of the Random
class:
Providing an identical seed value to different Random objects causes each instance to produce identical sequences of random numbers.
Only do note that PRNGs use numeric seeds rather than strings, as per your example in the question. And if you need a cryptographically secure PRNG, then you'll need to use a class other than Random
, although the same principles regarding seeds apply.