Able to load and understand a database

pull/2/head
Louis Chatriot 12 years ago
parent 4ee4744312
commit cb42b85f53
  1. 5
      lib/customUtils.js

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

Loading…
Cancel
Save