diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-06-29 09:27:21 -0500 |
---|---|---|
committer | Donald Stufft <donald@stufft.io> | 2016-06-29 10:27:21 -0400 |
commit | c9a9ec1e7a39949b1d09d72746fad6a1d681a80b (patch) | |
tree | 6726e1973f4c55af714bc9c4c77d76d772d59a7c /README.rst | |
parent | 81e8efd0cf48ecf3acfe4c205489c8301ca28045 (diff) | |
download | py-bcrypt-git-c9a9ec1e7a39949b1d09d72746fad6a1d681a80b.tar.gz |
Add checkpw (#76)
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -37,6 +37,10 @@ For Fedora and RHEL-derivatives, the following command will ensure that the requ Changelog ========= +3.1.0 +----- +* Added support for ``checkpw`` as another method of verifying a password. + 3.0.0 ----- * Switched the C backend to code obtained from the OpenBSD project rather than @@ -51,8 +55,8 @@ Changelog Usage ----- -Hashing -~~~~~~~ +Password Hashing +~~~~~~~~~~~~~~~~ Hashing and then later checking that a password matches the previous hashed password is very simple: @@ -63,9 +67,9 @@ password is very simple: >>> password = b"super secret password" >>> # Hash a password for the first time, with a randomly-generated salt >>> hashed = bcrypt.hashpw(password, bcrypt.gensalt()) - >>> # Check that a unhashed password matches one that has previously been - >>> # hashed - >>> if bcrypt.hashpw(password, hashed) == hashed: + >>> # Check that an unhashed password matches one that has previously been + >>> # hashed + >>> if bcrypt.checkpw(password, hashed): ... print("It Matches!") ... else: ... print("It Does not Match :(") |