From cb42b85f53337517c6ae62bd7b388bf17d8b7aad Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Wed, 1 May 2013 20:28:17 +0100 Subject: [PATCH] Able to load and understand a database --- lib/customUtils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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));