I've found that using strings that consist of repeating patterns cause the number generator to return identical results.
For example, suppose that you seed seedrandom with a string 'sfsf'. Then seed it again with 'sfsfsf'. Both number generators will produce 0.12427751372875664 on the first call.
In Node.js:
let rngA = seedrandom('sf');
let a = rngA();
let rngB = seedrandom('sfsf');
let b = rngB();
assert(a !== b);
It doesn't seem to matter how many times the pattern repeats. I could use 'sfsfsf' or 'sfsfsfsfsfsf' and get the same result.
I would expect these to be totally different values because they are different strings.
I've found that using strings that consist of repeating patterns cause the number generator to return identical results.
For example, suppose that you seed
seedrandom
with a string 'sfsf'. Then seed it again with 'sfsfsf'. Both number generators will produce 0.12427751372875664 on the first call.In Node.js:
It doesn't seem to matter how many times the pattern repeats. I could use 'sfsfsf' or 'sfsfsfsfsfsf' and get the same result.
I would expect these to be totally different values because they are different strings.