diff --git a/lib/customUtils.js b/lib/customUtils.js index e0a6167..af46b07 100644 --- a/lib/customUtils.js +++ b/lib/customUtils.js @@ -24,9 +24,10 @@ function ensureDirectoryExists (dir, cb) { * Return a random string of length len */ function uid (len) { - return crypto.randomBytes(Math.ceil(len * 3 / 4)) + return crypto.randomBytes(Math.ceil(len * 5 / 4)) .toString('base64') - //.slice(0, len); + .replace(/[+\/]/g, '') + .slice(0, len); } console.log(uid(5));