title: Providing a salt for encryption with 'crypt()' isn't affecting the output + questions on crypt
body: <p>I have this code in a PHP page which I am running multiple times. Every time I refresh the page, the salt changes (as it should), but the hash output stays the same.</p>
  
  <pre><code>$iv = mcrypt_create_iv(22);
  $ro = rand(6, 9);
  $salt = '$2y$'.$ro.'$'.$iv.'$';
  echo $salt;
  echo '&lt;br /&gt;';
  $crypt = crypt('test', $salt);
  echo $crypt;
  </code></pre>
  
  <p>Shouldn't the random salt affect the output and make it so that every time I refresh the page the crypt result changes too?</p>
  
  <p>I also have a few general questions on <code>crypt()</code>.</p>
  
  <p>Is there any way for you to use a specific hashing algorithm with this function? I would like to use the blowfish algorithm. </p>
  
  <p>Is it the salt length/format that affects which algorithm it chooses?</p>
  
  <p>Lastly, should the salt length for the blowfish algorithm always be 22 characters, or is that just the maximum?</p>
  
  <p>By the way, if anyone is wondering (and if it matters for answering these questions and wasn't obvious), I'm planning to use something similar to store hashed passwords.</p>
  
  <p>Thank you for looking!</p>