A Universally Unique IDentifier abbreviated as UUID is a 36 character 128-bit alphanumeric string that are usually used in databases in order to distinguish rows of data from each other by assigning a UUID to each row. An example of a UUID is the following: 8cfef326-6f3d-49b9-b512-da23c0d94852
.
While there are several different versions of UUID, the built-in UUID available in Javascript uses V4. In order to create a UUID in Javascript we use the crypto
interface:
const createUUID = crypto.randomUUID();
console.log(createUUID); //c8657468-3947-4552-8b47-9a8dfbc397d7