diff options
Diffstat (limited to 'README')
-rw-r--r-- | README | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -40,10 +40,13 @@ A simple example that demonstrates most of the features: hashed = bcrypt.hashpw(password, bcrypt.gensalt(10)) # Check that an unencrypted password matches one that has - # previously been hashed - if bcrypt.hashpw(plaintext, hashed) == hashed: + # previously been hashed. + if bcrypt.checkpw(plaintext, hashed): print "It matches" else: print "It does not match" + # Generate a 256-bit cryptographic key + key = bcrypt.kdf(password, salt, 100, 256/8) + $Id$ |