title: Do I need to store the salt with bcrypt?
body: <p><a href="http://www.mindrot.org/files/jBCrypt/jBCrypt-0.2-doc/" rel="noreferrer">bCrypt's javadoc</a> has this code for how to encrypt a password:</p>
  
  <pre><code>String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt()); 
  </code></pre>
  
  <p>To check whether a plaintext password matches one that has been hashed previously, use the checkpw method:</p>
  
  <pre><code>if (BCrypt.checkpw(candidate_password, stored_hash))
      System.out.println("It matches");
  else
      System.out.println("It does not match");
  </code></pre>
  
  <p>These code snippets imply to me that the randomly generated salt is thrown away. Is this the case, or is this just a misleading code snippet?</p>