diff --git a/index.js b/index.js index 1fc51ce..90c40e0 100644 --- a/index.js +++ b/index.js @@ -81,9 +81,17 @@ Helper.uuid = function(pipe = '-') { __inc__ = 1024 } - inc = (__inc__ + PID + PPID).toString(16).padStart(4, '0') + inc = (__inc__ + PID + PPID).toString(16).padStart(4, '0') + rand.slice(0, 4) - return now + pipe + inc + pipe + rand.slice(0, 4) + pipe + rand.slice(-8) + return ( + now + + pipe + + inc.slice(0, 4) + + pipe + + inc.slice(4, 8) + + pipe + + rand.slice(-8) + ) } /** diff --git a/index.mjs b/index.mjs index 3072c02..18932d9 100644 --- a/index.mjs +++ b/index.mjs @@ -81,9 +81,17 @@ export function uuid(pipe = '-') { __inc__ = 1024 } - inc = (__inc__ + PID + PPID).toString(16).padStart(4, '0') + inc = (__inc__ + PID + PPID).toString(16).padStart(4, '0') + rand.slice(0, 4) - return now + pipe + inc + pipe + rand.slice(0, 4) + pipe + rand.slice(-8) + return ( + now + + pipe + + inc.slice(0, 4) + + pipe + + inc.slice(4, 8) + + pipe + + rand.slice(-8) + ) } /** diff --git a/package.json b/package.json index 89c9d12..209c459 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crypto.js", - "version": "2.0.3", + "version": "2.0.4", "description": "原生crypto加密模块的二次封装,简化常用加密函数的使用", "keywords": [ "md5",