How to use the uuid/v5.DNS function in uuid

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", "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 fttx / barcode-to-pc-server / ionic / src / providers / electron / electron.ts View on Github external
// console.log('test')
    if (this.isElectron()) {
      let electron = window.require('electron');

      this.ipcRenderer = electron.ipcRenderer;
      this.dialog = electron.remote.dialog;
      this.app = electron.remote.app;
      this.shell = electron.shell;
      this.process = electron.remote.process;
      this.remote = electron.remote;
      this.menu = electron.remote.Menu;
      this.menuItem = electron.remote.MenuItem;
      this.ElectronStore = electron.remote.require('electron-store');
      this.v5 = electron.remote.require('uuid/v5');

      this.uuid = v5('license.barcodetopc.com', v5.DNS);
    }
  }
github floating / frame / main / api / trusted.js View on Github external
module.exports = origin => {
  if (!origin || origin === 'null') origin = 'Unknown' // Permission granted to unknown origins only persist until the Frame is closed, they are not permanent
  if (invalidOrigin(origin)) return false
  if (origin === 'frame-extension') return true
  const account = accounts.current()
  if (!account) return
  const address = account.addresses[account.index]
  if (!address) return
  const permissions = store('main.addresses', address, 'permissions') || {}
  const perms = Object.keys(permissions).map(id => permissions[id])
  const permIndex = perms.map(p => p.origin).indexOf(origin)
  const handlerId = uuidv5(origin, uuidv5.DNS)
  if (permIndex === -1) accounts.addRequest({ handlerId, type: 'access', origin, address })
  return perms[permIndex] && perms[permIndex].provider
}
github knorm / knorm / test / Model / Validate.spec.js View on Github external
          () => validate.uuid5(uuid5('foo.com', uuid5.DNS)),
          'to throw',
github knorm / knorm / test / Model / Validate.spec.js View on Github external
      expect(() => validate.uuid(uuid5('foo.com', uuid5.DNS)), 'not to throw');
    });
github SuperMarcus / airprint-proxy / src / Printer.js View on Github external
if (typeof port === "string" &&
            utils.isUndef(notes) &&
            utils.isUndef(host)){
            notes = port;
            port = undefined;
        }

        this.ip = ip;
        //If name is not set, just generate a random name instead
        this.name = name || "Untitled Bonjour Printer " + parseInt(Math.random() * 100000);
        this.host = host || (this.name.toLowerCase().replace(/\s+/g, "-") + ".local");
        this.service = this.name + "._ipp._tcp.local";
        this.serviceIpps = this.name + "._ipps._tcp.local";
        this.port = utils.opt(port, matchedResults[3]) || 631;//Default CUPS port
        this.presets = utils.assign({}, defaultOptions);
        this.uuid = uuidv5(this.host, uuidv5.DNS);
        this.useIpps = utils.opt(matchedResults[1], "").toLowerCase() === "ipps";
        this.options = {};

        this.setOption("UUID", this.uuid);
        this.setQueue(matchedResults[4]);
        this.setNotes(notes);

    } else console.error("Printer is not a function, it's a class.");
}
github floating / frame / main / store / state / index.js View on Github external
Object.keys(initial.main.addresses).forEach(address => {
  address = initial.main.addresses[address]
  if (address && address.permissions) {
    delete address.permissions[uuidv5('Unknown', uuidv5.DNS)]
  }
})