How to use the short-uuid function in short-uuid

To help you get started, we’ve selected a few short-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 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 / 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}`;
};
github AJInteractive / InterviewJS / packages / composer / src / partials / panes / user / tabs / Image.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 / modals / PublishStoryModal.js View on Github external
const computeId = (userId, storyId) => {
  let namespace = userId;
  if (namespace.indexOf(":") > 0) namespace = namespace.split(":").pop();

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

  const uuid = uuidv5(id, namespace);
  return shortUuid().fromUUID(uuid);
};
github AJInteractive / InterviewJS / packages / lambda / story.js View on Github external
const computeId = (userId, storyId) => {
  let namespace = userId;
  if (namespace.indexOf(":") > 0) namespace = namespace.split(":").pop();

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

  const uuid = uuidv5(id, namespace);
  return shortUuid().fromUUID(uuid);
};
github AJInteractive / InterviewJS / packages / lambda / story.js View on Github external
const computeId = (userId, storyId) => {
  let namespace = userId;
  if (namespace.indexOf(":") > 0) namespace = namespace.split(":").pop();

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

  const uuid = uuidv5(id, namespace);
  return shortUuid().fromUUID(uuid);
};

short-uuid

Create and translate standard UUIDs with shorter formats.

MIT
Latest version published 5 days ago

Package Health Score

70 / 100
Full package analysis