optimize random_string
This commit is contained in:
parent
c0ec49fd4b
commit
cb9c142547
1
index.js
1
index.js
@ -39,7 +39,6 @@ function random_string (len = 8) {
|
|||||||
throw new Error ('invalid length');
|
throw new Error ('invalid length');
|
||||||
return crypto.randomBytes (Math.ceil (len * 3 / 4))
|
return crypto.randomBytes (Math.ceil (len * 3 / 4))
|
||||||
.toString ('base64')
|
.toString ('base64')
|
||||||
.replace (/[=]+$/u, '')
|
|
||||||
.substr (0, len);
|
.substr (0, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ module.exports = function(config) {
|
|||||||
config.set({
|
config.set({
|
||||||
mutator: "javascript",
|
mutator: "javascript",
|
||||||
packageManager: "yarn",
|
packageManager: "yarn",
|
||||||
reporters: ["clear-text"],
|
reporters: ["clear-text", "progress"],
|
||||||
testRunner: "command",
|
testRunner: "command",
|
||||||
transpilers: [],
|
transpilers: [],
|
||||||
coverageAnalysis: "all",
|
coverageAnalysis: "all",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user