diff --git a/index.js b/index.js index 6b0c9c4..5b2aa49 100644 --- a/index.js +++ b/index.js @@ -99,8 +99,8 @@ module.exports = { let rand = CRYPTO.randomBytes(8).toString('hex') let stamp = ((Date.now() / 1000) >>> 0).toString(16) - rand = rand.replace(/^([0-9a-z]{8})([0-9a-z]{4})([0-9a-z]{4})$/, '$1-$2-$3') - return rand + '-' + stamp + rand = rand.replace(/^([0-9a-z]{4})([0-9a-z]{4})([0-9a-z]{8})$/, '$1-$2-$3') + return stam + '-' + prand }, /** diff --git a/package.json b/package.json index 6f29274..1f98a8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crypto.js", - "version": "1.1.0", + "version": "1.1.1", "description": "原生crypto加密模块的二次封装,简化常用加密函数的使用", "keywords": [ "md5",