title: Generating Strong Unique User ID's w/PHP & MySQL
body: <p>Ahoy Stack Overflow!  This be mai first post... </p>
  
  <p><em>I'm attempting to identify users with a salted unique public key.</em></p>
  
  <ol>
  <li><strong><em>Algorithm</em></strong> - Should I use uniqid(), sha256, sha512, something else?  All hashes will be salted.  NIST recommended SHA256, but I prefer to hear what others might suggest.</li>
  <li><strong><em>Generation</em></strong> - Does hash(SALT + <code>AUTO_INCREMENT_PK</code> + <code>CREATED_TIMESTAMP</code>) suffice?  More entropy?
  
  <ul>
  <li>I'd use email, as it is unique for each user, however the user can modify their email address.  I was also considering storing signup_email so that hashes would not have to be re-calculated.</li>
  </ul></li>
  <li><strong><em>MySQL Storage</em></strong> - Currently, our ID's are INT(255) <code>auto_increment</code> primary key's.  As stated earlier, potentially hundreds of millions of keys.  Depending on the crypto algo, I should have a fixed-size ID.  Can I keep INT(255) or should I use CHAR(n)?</li>
  </ol>
  
  <p><code>---------------------- Thanks for reading :) -------------------------------</code></p>