title: correct way to exclude certain characters from crypto.randomBytes
body: <p>i have the following code, based on <a href="http://nodejs.org/docs/v0.6.9/api/crypto.html#randomBytes" rel="nofollow">http://nodejs.org/docs/v0.6.9/api/crypto.html#randomBytes</a></p>
  
  <pre><code>crypto.randomBytes 32, (ex, buf) -&gt;
    user.tokenString = buf.toString("hex")
    user.tokenExpires = Date.now() + TOKEN_TIME
    next()
  </code></pre>
  
  <p>i am using this to generate a tokenString to use for a node.js/express user validation.</p>
  
  <p>in some cases the tokenString generated includes '/' forward slash character, and this breaks my routes, for example, tokenString if the tokenString is like '<code>$2a$10$OYJn2r/Ts.guyWqx7iJTwO8cij80m.uIQV9nJgTt18nqu8lT8OqPe</code>' it can't find <code>/user/activate/$2a$10$OYJn2r</code> and i get an 404 error </p>
  
  <p>is there a more direct way to exclude certain characters from being included when generating the crypto.randomBytes?</p>