title: How to compare plain text password to hashed password using bcrypt?
body: <p>I would like to use <code>bcrypt</code> to hash passwords and later verify if a supplied password is correct.</p>
  
  <p>Hashing passwords is easy:</p>
  
  <pre><code>import bcrypt
  
  password = u'foobar'
  password_hashed = bcrypt.hashpw(password, bcrypt.gensalt())
  
  # then store password_hashed in a database
  </code></pre>
  
  <p>How can I compare a plain text password to the stored hash?</p>