|
楼主 |
发表于 2014-10-24 00:32:02
|
显示全部楼层
随机的 那个不用管 这是ssoext的算法 a和b空就行了 uniqid() 。
function uniqid(a, b) {
"undefined" == typeof a && (a = "");
var c, d = function (a, b) {
return a = parseInt(a, 10).toString(16), b < a.length ? a.slice(a.length - b) : b > a.length ? Array(1 + (b - a.length)).join("0") + a : a;
};
return this.php_js || (this.php_js = {}), this.php_js.uniqidSeed || (this.php_js.uniqidSeed = Math.floor(123456789 * Math.random())), this.php_js.uniqidSeed++, c = a, c += d(parseInt((new Date).getTime() / 1e3, 10), 8), c += d(this.php_js.uniqidSeed, 5), b && (c += (10 * Math.random()).toFixed(8).toString()), c;
} |
|