How to use uuid - 10 common examples

To help you get started, we’ve selected a few uuid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / uuid_v3.x.x / test_uuid_v3.x.x.js View on Github external
v3("bla", v3.DNS);
v3("bla", v3.URL);
v3([0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea]);
v3(
  [0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea],
  [0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36]
);

// $ExpectError
v3("bla", { yolo: true });

v5.name;
v5("bla");
v5("bla", "bla");
v5("bla", v5.DNS);
v5("bla", v5.URL);
v5([0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea]);
v5(
  [0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea],
  [0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36]
);

// $ExpectError
v5("bla", { yolo: true });
github flow-typed / flow-typed / definitions / npm / uuid_v2.x.x / test_uuid_v2.x.x.js View on Github external
]
});

uuid.v4({
  // Fake random number generator
  rng: () => Buffer.alloc(16)
});

// $ExpectError
uuid.v4({
  rng: () => 'bla'
});

// $ExpectError
uuid.parse([23]);
const buffer1 = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10');
uuid.unparse(buffer1);
github flow-typed / flow-typed / definitions / npm / uuid_v2.x.x / test_uuid_v2.x.x.js View on Github external
0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36
  ]
});

uuid.v4({
  // Fake random number generator
  rng: () => Buffer.alloc(16)
});

// $ExpectError
uuid.v4({
  rng: () => 'bla'
});

// $ExpectError
uuid.parse([23]);
const buffer1 = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10');
uuid.unparse(buffer1);
github flow-typed / flow-typed / definitions / npm / uuid_v3.x.x / test_uuid_v3.x.x.js View on Github external
});

// $ExpectError
uuid.v4({
  rng: () => "bla"
});

// $ExpectError
v4({
  rng: () => "bla"
});

v3.name;
v3("bla");
v3("bla", "bla");
v3("bla", v3.DNS);
v3("bla", v3.URL);
v3([0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea]);
v3(
  [0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea],
  [0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36]
);

// $ExpectError
v3("bla", { yolo: true });

v5.name;
v5("bla");
v5("bla", "bla");
v5("bla", v5.DNS);
v5("bla", v5.URL);
v5([0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea]);
github flow-typed / flow-typed / definitions / npm / uuid_v3.x.x / test_uuid_v3.x.x.js View on Github external
rng: () => Buffer.alloc(16)
});

// $ExpectError
uuid.v4({
  rng: () => "bla"
});

// $ExpectError
v4({
  rng: () => "bla"
});

v3.name;
v3("bla");
v3("bla", "bla");
v3("bla", v3.DNS);
v3("bla", v3.URL);
v3([0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea]);
v3(
  [0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea],
  [0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36]
);

// $ExpectError
v3("bla", { yolo: true });

v5.name;
v5("bla");
v5("bla", "bla");
v5("bla", v5.DNS);
v5("bla", v5.URL);
github flow-typed / flow-typed / definitions / npm / uuid_v3.x.x / test_uuid_v3.x.x.js View on Github external
rng: () => "bla"
});

v3.name;
v3("bla");
v3("bla", "bla");
v3("bla", v3.DNS);
v3("bla", v3.URL);
v3([0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea]);
v3(
  [0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea],
  [0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36]
);

// $ExpectError
v3("bla", { yolo: true });

v5.name;
v5("bla");
v5("bla", "bla");
v5("bla", v5.DNS);
v5("bla", v5.URL);
v5([0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea]);
v5(
  [0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea],
  [0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36]
);

// $ExpectError
v5("bla", { yolo: true });
github flow-typed / flow-typed / definitions / npm / uuid_v3.x.x / test_uuid_v3.x.x.js View on Github external
// $ExpectError
uuid.v4({
  rng: () => "bla"
});

// $ExpectError
v4({
  rng: () => "bla"
});

v3.name;
v3("bla");
v3("bla", "bla");
v3("bla", v3.DNS);
v3("bla", v3.URL);
v3([0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea]);
v3(
  [0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea],
  [0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36]
);

// $ExpectError
v3("bla", { yolo: true });

v5.name;
v5("bla");
v5("bla", "bla");
v5("bla", v5.DNS);
v5("bla", v5.URL);
v5([0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea]);
v5(
github flow-typed / flow-typed / definitions / npm / uuid_v3.x.x / test_uuid_v3.x.x.js View on Github external
v3("bla", "bla");
v3("bla", v3.DNS);
v3("bla", v3.URL);
v3([0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea]);
v3(
  [0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea],
  [0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36]
);

// $ExpectError
v3("bla", { yolo: true });

v5.name;
v5("bla");
v5("bla", "bla");
v5("bla", v5.DNS);
v5("bla", v5.URL);
v5([0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea]);
v5(
  [0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea],
  [0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36]
);

// $ExpectError
v5("bla", { yolo: true });
github AJInteractive / InterviewJS / packages / composer / src / partials / panes / interviewee / ImagePane.js View on Github external
const fileToKey = (data, storyId) => {
  const { name, type } = data;
  // console.log(name, type);

  let namespace = storyId;
  if (namespace.indexOf("_")) namespace = namespace.split("_").pop();
  if (namespace.length < 36) namespace = shortUuid().toUUID(namespace);

  const uuid = uuidv5(`${type},${name}`, namespace);
  return `${shortUuid().fromUUID(uuid)}-${name}`;
};
github AJInteractive / InterviewJS / packages / composer / src / partials / forms / MetaForm.js View on Github external
const fileToKey = (data, storyId) => {
  const { name, type } = data;
  // console.log(name, type);

  let namespace = storyId;
  if (namespace.indexOf("_")) namespace = namespace.split("_").pop();
  if (namespace.length < 36) namespace = shortUuid().toUUID(namespace);

  const uuid = uuidv5(`${type},${name}`, namespace);
  return `${shortUuid().fromUUID(uuid)}-${name}`;
};