title: How should I store my sha512 salted & hashed passwords in MySQL?
body: <p>All,</p>
  
  <p>I am using the following PHP function to salt &amp; hash user passwords for a web app:  </p>
  
  <pre><code>function stringHashing($password,$salt){
   $hashedString=$password.$salt;
   for ($i=0; $i&lt;50; $i++){
    $hashedString=hash('sha512',$password.$hashedString.$salt);
    }
   return $hashedString;
  }  
  </code></pre>
  
  <p>What is the best way to store the resulting string in MySQL?  I suppose it is a fixed CHAR field?  How should I go about calculating the right length?</p>
  
  <p>Thanks,</p>
  
  <p>JDelage</p>