It, mostly, depends on the seed generator of the underlying system. If two clients have the same exact seed, then the sequence will end up being the same...generally. There may be slight differences between the different implementations but the default falls back on the implementation in Java: Dig this SO question for additional info.
Generally the seed is a "bit better", aka slightly "more random" than just a timestamp.
Specifically:
V8
on Windows will use two different s_rand
calls and bit arithmetic to get the seed for the generator. If /dev/urandom
exists, it will use it instead. urandom
is farely good as it does not simply use a unix timestamp but environmental noise. If both options are not available, V8 will just use different time stamps and mathematically combine them. However, the sequence of random numbers is not directly pulled from Java, and will probably not have the exact same sequence as a FireFox client as getting the next random number uses a different mathematical formula.
Firefox does something very similarly and it looks like they lifted the definition from Java. As for the seed, again, its generation is very similar to that of V8, using s_rand
on windows /dev/urandom
when it is available, and falling back on timestamps when neither are available.
All in all, the generation is "pseudo-random" and if the calculation of the next random number is the same(Chrome and Firefox differ slightly on this) and the two sequences are started with the same exact seed, then of course, the two clients will have the exact same sequence of numbers. Statistically, the chances of this happening are insignificant, but conceivably, it indeed can happen.
Dig the following sources for some more in depth statistical, mathematical goodness.
Sources:
- Firefox implementation of math_random
- V8's implementation
- Breaking the Java random number generator
- Predicting the Seed in JS