title: is base64 encoding url safe?
body: <p>I'm using a node.bcrypt.js hash returning hex numbers in node.js for a password reset token.</p>
  
  <pre><code>user.reset_password_token = require('crypto').randomBytes(32).toString('hex'
  );
  </code></pre>
  
  <p>Should I also base64 encode the token before I pass it around in urls (ie: link reset email)?</p>
  
  <p>Is there any benefit to doing this?</p>
  
  <p>I seem to recall base64 encoding can contain forward slashes which would mess up the path:</p>
  
  <pre><code>   var token = user.reset_password_token;
  
     //is there any benefit to doing base64 encoding?
     var encoded_token = new Buffer(token).toString('base64');
  
     var reset_link = 'http://example.com/reset/'+ encoded_token;
     sendResetLink( reset_link );
  </code></pre>