方法一. function uuid() { var s = []; var hexDigits = "0123456789abcdef"; for (var i = 0; i < 36; i++) { s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); } s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 001…
Generate name based md5 UUID (version 3) /** * Generate name based md5 UUID (version 3). * @example '7e57d004-2b97-0e7a-b45f-5387367791cd' */ public function uuid() { // fix for compatibility with 32bit architecture; seed range restricted to 62bit $s…