From 52af19e58e9de4e9682c5676ca0d2b6b70482476 Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 18 Oct 2023 19:20:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96`uuid()`,=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9C=89=E5=BA=8F=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md | 4 ++++ package.json | 2 +- src/index.mjs | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index a9bc07b..ba42771 100644 --- a/Readme.md +++ b/Readme.md @@ -2,6 +2,10 @@ > 本模块是对原生的`crypto`模块二次封装的,在使用上更加简单方便。 ## 更新日志 + ++ v3.1.2 + - 优化`uuid()`, 增加有序性 + + v3.1.0 - 优化`uuid(),rand()` - 优化库引用方式 diff --git a/package.json b/package.json index e60a2fe..f7bfc12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crypto.js", - "version": "3.1.1", + "version": "3.1.2", "description": "原生crypto加密模块的二次封装,简化常用加密函数的使用", "keywords": [ "md5", diff --git a/src/index.mjs b/src/index.mjs index 51fd11e..afd3600 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -27,7 +27,7 @@ const MAC = (function (ns) { return Math.random().toString(16).slice(-4) })(os.networkInterfaces()) -var __inc__ = 1 +var __inc__ = 4096 /** * [base64encode base64编码] @@ -90,7 +90,7 @@ export function uuid(pipe = '-') { var now = (~~(Date.now() / 1000)).toString(16) if (__inc__ > 65535) { - __inc__ = 1 + __inc__ = 4096 } str = __inc__.toString(16) + str