diff --git a/package.json b/package.json index 173b49e..e60a2fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crypto.js", - "version": "3.1.0", + "version": "3.1.1", "description": "原生crypto加密模块的二次封装,简化常用加密函数的使用", "keywords": [ "md5", diff --git a/src/index.mjs b/src/index.mjs index 3a0343a..51fd11e 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -89,11 +89,12 @@ export function uuid(pipe = '-') { var str = origin.randomUUID() var now = (~~(Date.now() / 1000)).toString(16) - __inc__++ if (__inc__ > 65535) { __inc__ = 1 } - str += __inc__.toString(16) + + str = __inc__.toString(16) + str + __inc__++ return now + pipe + MAC + pipe + str.slice(0, 4) + pipe + str.slice(-8) }