优化uuid

master
宇天 2018-07-01 23:57:44 +08:00
parent 116c3315df
commit 54e1ce3c43
2 changed files with 3 additions and 3 deletions

View File

@ -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
},
/**

View File

@ -1,6 +1,6 @@
{
"name": "crypto.js",
"version": "1.1.0",
"version": "1.1.1",
"description": "原生crypto加密模块的二次封装,简化常用加密函数的使用",
"keywords": [
"md5",