How to use the short-uuid.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 DecenterApps / MatchChannels / etherships / src / actions / userActions.js View on Github external
export const initAccount = () => (dispatch, getState) =>  {
    let peerId = localStorage.getItem('peer');

   console.log("Peerid: ", peerId);

    if(!peerId) {
      peerId = short.uuid();

      localStorage.setItem('peer', peerId);
    }

    const peer = webrtc.createPeer(peerId);

    const board = localStorage.getItem('board');
    let user = localStorage.getItem('user');

    peer.on('connection', (_conn) => {

      _conn.on('open', (d) => {
        console.log('Conn open - receiver side', d);
        // closeModal()(dispatch);
      });
github DecenterApps / MatchChannels / etherships / src / services / webrtcService.js View on Github external
peer.on('error', (err) => {
      console.log('error', err);

      if(err.message.indexOf('is taken') !== -1) {
        localStorage.setItem('peer', short.uuid());
        window.location.reload();
      } else if(err.message.indexOf('Could not connect to peer ') !== -1) {
         localStorage.removeItem('user');
         localStorage.removeItem('board');
      }
    });
github AJInteractive / InterviewJS / packages / composer / src / partials / forms / MetaForm.js View on Github external
id: string,
    author: string,
    authorLink: string,
    cover: string,
    logo: string,
    pubDate: string,
    title: string,
  }),
};

MetaForm.defaultProps = {
  cta: "Save",
  handleSave: null,
  required: false,
  story: {
    id: shortUuid().fromUUID(shortUuid.uuid()),
    author: "",
    authorLink: "",
    cover: "",
    logo: "",
    pubDate: "",
    title: "",
  },
};
github connect-foundation / 2019-09 / server / service / game / controllers / roomController.js View on Github external
const generateRoomId = () => {
  let roomId = short.uuid();
  while (rooms[roomId]) {
    roomId = short.uuid();
  }
  return roomId;
};
github connect-foundation / 2019-09 / server / service / game / controllers / roomController.js View on Github external
const generateRoomId = () => {
  let roomId = short.uuid();
  while (rooms[roomId]) {
    roomId = short.uuid();
  }
  return roomId;
};

short-uuid

Create and translate standard UUIDs with shorter formats.

MIT
Latest version published 6 months ago

Package Health Score

70 / 100
Full package analysis