title: How to do an Encode/Decode function in Base62 with no obvious pattern in the Results?
body: <p>I have a site where users must confirm their e-mail using a typical e-mail confirmation script  with a specific (but long) Confirmation Link for each user that includes the usual hash parameter.</p>
  
  <p>The problem I'm having is that some users are having problems with the long and complicated Confirmation Link due to the device they are using.</p>
  
  <p>So I need to create an alternative way to generate the unique Confirmation Link for each user such that no pattern is obvious so that it cannot be figured out and abused.</p>
  
  <p>I've been looking at Base62 encoding and decoding, but the one I found is based on numbers only, which would limit me to using the sequential unique User ID's, which then creates an obvious sequential pattern in the encoded results which could easily be abused.</p>
  
  <p>Preferably, I want a solution that will not require me to alter the DB.</p>
  
  <p>Ideally, I would like to basically create a shortened URL similar to how Bit.ly and other url shorteners create their unique URL's, but that can be encoded and decoded either off of the User ID, username, or e-mail, and preferably have the encoding/decoding "salted" with a unique key so that no pattern emerges in the encoded results.</p>
  
  <p>EXAMPLE:</p>
  
  <p>So instead of the confirmation link looking like:</p>
  
  <pre><code>http://domain.com/confirm?email=blah@blah.com&amp;hash=1f3870be274f6c49b3e31a0c6728957f
  </code></pre>
  
  <p>I would like it to look like:</p>
  
  <pre><code>http://domain.com/confirm/Sg5rdn
  </code></pre>
  
  <p>Where I would then simply decode Sg5rdn to get the Username, User ID, or E-mail of the user and confirm them.</p>
  
  <p><strong>Is this even possible?</strong>  </p>