Math.random in V8 is broken
This is actually a solved problem already on most underlying operating systems, it just hasn&#x27;t filtered down into the Javascript-world. On Windows you want a GUID and on UNIX-like OSs you want a UUID.<p>GUIDs and UUIDs are guaranteed to be unique not simply because of their length, but also how they&#x27;re constructed (MAC address, timestamp, and a random element).<p>So even if the random number generator does loop back around, it still won&#x27;t ever generate the same GUID&#x2F;UUID even on the same hardware, and on other hardware it is more unlikely yet still (due to MAC address).<p>So the question is: Why isn&#x27;t GUID&#x2F;UUID generation not available to Javascript? It works extremely well and is used for exactly this type of scenario.