Get Unique ID - Node.js Security

Node.js examples for Security:GUID

Description

Get Unique ID

Demo Code


var getUniqueID = (function() {
  function s4() {
    return Math.floor((1 + Math.random()) * 0x10000)
  .toString(16)/*from  w  ww.  j av a2  s  .  com*/
  .substring(1);
  }
  return function() {
    return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
  s4() + '-' + s4() + s4() + s4();
  };
})();

Related Tutorials