TIFU by using Math.random()
medium.com
medium.com
Even for the distributed case, how would a PRNG be better than an incrementing counter - perhaps where the high bits are locked down to an instance ID?
All of that is sort of beside the point though. Pseudo-random sequences are useful for lots of things and the PRNG algorithm behind Math.random() is pretty crappy.
What if you use a PRNG to initially seed an incremental counter? I don't really see how that would that be weaker than using a PRNG for each value? Is it just that the obfuscated period and pattern of a PRNG makes it "feel" less likely to collide?
On the plus side, I think that means the risk that you get a collision is smaller.
Also, using bare incrementing counters may be a bad idea for different reasons: it allows attackers to guess IDs of future messages. You can counteract that by hashing the IDs using a good cryptographic hash function, but that effectively turns your ID generating process into a PRNG.