Comparing version 1.2.0 to 1.2.1
@@ -86,6 +86,23 @@ 'use strict'; | ||
*/ | ||
exports.makeNonce = function () { | ||
return '' + Math.floor(Math.random() * 1000000000000); | ||
}; | ||
exports.makeNonce = (function() { | ||
var counter = 0; | ||
var last; | ||
const machine = os.hostname(); | ||
const pid = process.pid; | ||
return function () { | ||
var val = Math.floor(Math.random() * 1000000000000); | ||
if (val === last) { | ||
counter++; | ||
} else { | ||
counter = 0; | ||
} | ||
last = val; | ||
var uid = `${machine}${pid}${val}${counter}`; | ||
return exports.md5(uid, 'hex'); | ||
}; | ||
}()); | ||
/** | ||
@@ -92,0 +109,0 @@ * Pad a number as \d\d format |
{ | ||
"name": "kitx", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "toolkit", | ||
@@ -31,3 +31,3 @@ "main": "lib/index.js", | ||
"istanbul": "~0.4.2", | ||
"mocha": "~2.3.4" | ||
"mocha": "^3.4.2" | ||
}, | ||
@@ -34,0 +34,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7665
180