function uid(length, cb) {
  var numbytes = Math.ceil(length * ratio);
  if (typeof cb === 'undefined') {
    return urlReady(crypto.randomBytes(numbytes).toString('base64').slice(0, length));
  } else {
    crypto.randomBytes(numbytes, function(err, bytes) {
       if (err) return cb(err);
       cb(null, urlReady(bytes.toString('base64').slice(0, length)));
    })
  }
}
Generate an Unique Id

@param {Number} length  The number of chars of the uid
@param {Number} cb (optional)  Callback for async uid generation
@api public