summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
Diffstat (limited to 'README')
-rw-r--r--README7
1 files changed, 5 insertions, 2 deletions
diff --git a/README b/README
index a7b12a4..f2d97b7 100644
--- a/README
+++ b/README
@@ -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$