Globally Unique Identifier (GUID)

Inspired by Banner (ERP) Student API Handbook 9.5

GUIDs can be generated using various programming languages such as Java or C#/.NET. Many languages provide a utility function for generating version 4 GUIDs. Since Java 1.5, java.util.UUID.randomUUID() has been used to generate random, unique 128 bit numbers. .NET provides the Guid.NewGuid() function. Microsoft SQL Server provides the NEWID() method call, e.g., SELECT NEWID();

Generation of GUIDs using JavaScript should be restricted to server side. Tools like TamperMonkey make subverting GUID generation relatively easy for clients. JavaScript does not have a built in method for generating version 4 GUIDs.

Use JavaScript to generate an RFC 4122 version 4 compliant UUID.

This program offsets the first 13 hex numbers by a hex portion of the timestamp, and once depleted offsets by a hex portion of the microseconds since pageload. If Math.random is on the same seed, both clients would have to generate the UUID the exact same number of microseconds since pageload (if high-perfomance time is supported) AND at the exact same millisecond (or 10,000+ years later) to get the same UUID: