From 9abf20808471216a475104408a439afa87538d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Thu, 24 Jun 2021 14:04:32 +0800 Subject: [PATCH] fixed --- index.js | 12 ++++++++++-- index.mjs | 12 ++++++++++-- package.json | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) 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",