diff options
| author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-11-29 18:47:55 -0600 |
|---|---|---|
| committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-11-29 18:47:55 -0600 |
| commit | e89642d4bc0782eaaf0396cb79e28c08b542d2d0 (patch) | |
| tree | 9d566a3bb1ba0c20a875da05e4610e9dc6f83c29 | |
| parent | 1994f9192ba4d29a5bb41954a77314b8280a8d0d (diff) | |
| download | py-bcrypt-git-e89642d4bc0782eaaf0396cb79e28c08b542d2d0.tar.gz | |
updates based on feedback
| -rw-r--r-- | README.rst | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -89,15 +89,15 @@ Maxmimum Password Length The bcrypt algorithm only handles passwords up to 72 characters, any characters beyond that are ignored. To work around this, a common approach is to hash a -password with a cryptographic hash (such as ``sha256``) and then hex or base64 -encoding it to prevent NULL byte problems before hashing the result with +password with a cryptographic hash (such as ``sha256``) and then base64 +encode it to prevent NULL byte problems before hashing the result with ``bcrypt``: .. code:: pycon >>> password = b"an incredibly long password" * 10 >>> hashed = bcrypt.hashpw( - ... hashlib.sha256(password).hexdigest(), + ... base64.b64encode(hashlib.sha256(password).digest()), ... bcrypt.gensalt() ... ) |
