擅长:python、mysql、java
<p>文件中没有提到储存盐,只是说你必须:</p>
<pre><code>#Initial generation
hashed = bcrypt.hashpw(password, bcrypt.gensalt())
#Store hashed in your db
#Load hashed from the db and check the provided password
if bcrypt.hashpw(password, hashed) == hashed:
print "It matches"
else:
print "It does not match"
</code></pre>
<p><a href="http://www.mindrot.org/projects/py-bcrypt/" rel="noreferrer">http://www.mindrot.org/projects/py-bcrypt/</a></p>