Javascript String getUniqueID()

Description

Javascript String getUniqueID()


var getUniqueID = (function() {
 function s4() {//from   ww w .  j a  v  a 2 s . c o  m
  return Math.floor((1 + Math.random()) * 0x10000)
 .toString(16)
 .substring(1);
 }
 return function() {
  return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
 s4() + '-' + s4() + s4() + s4();
 };
})();



PreviousNext

Related