MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / UUID

Function UUID

modules/base/uuid/uuid.js:30–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28import Net from "net";
29
30function UUID() {
31 let time = new Date().getTime();
32 if (time < 1542410693111) {
33 // trace("Time not set. Generating random UUID.\n");
34 return UUIDv4();
35 } else {
36 // trace("Generating time-based UUID.\n");
37 return UUIDv1(time);
38 }
39}
40// Version 1 (Time-Based) UUID
41function UUIDv1(time) {
42 return [

Callers 1

constructorMethod · 0.85

Calls 3

UUIDv4Function · 0.85
UUIDv1Function · 0.85
getTimeMethod · 0.80

Tested by

no test coverage detected