diff options
| author | Eli Collins <elic@assurancetechnologies.com> | 2016-06-10 12:32:52 -0400 |
|---|---|---|
| committer | Eli Collins <elic@assurancetechnologies.com> | 2016-06-10 12:32:52 -0400 |
| commit | 281dacd121d72c7570442a13f2113f63c6c439ba (patch) | |
| tree | 997fcabde572da2fc5c8158243e26cce64ee3874 /admin | |
| parent | 61dc39910c6904c69f2e81d5dd41090cac1f18a1 (diff) | |
| download | passlib-281dacd121d72c7570442a13f2113f63c6c439ba.tar.gz | |
.encrypt() method renamed to .hash(), other api cleanups
.encrypt()
----------
hash.encrypt() & context.encrypt() have been renamed to .hash().
this should take care of the long-standing issue 21 (the poor naming of .encrypt).
per docs, legacy aliases will remain in place until passlib 2.0.
.genhash() / .genconfig()
-------------------------
taking advantage of this reorganization to also deprecate .genconfig()
and .genhash() -- they're not really useful in a modern system,
nor as needed for historical support as initially thought:
.genconfig() will be retired completely in passlib 2.0;
.genhash() is rolled into the new .hash() method along with .encrypt().
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/benchmarks.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/admin/benchmarks.py b/admin/benchmarks.py index 9c294a2..5ba52d0 100644 --- a/admin/benchmarks.py +++ b/admin/benchmarks.py @@ -201,7 +201,7 @@ def test_context_calls(): another__vary_rounds=100, ) def helper(): - hash = ctx.encrypt(SECRET, rounds=2001) + hash = ctx.hash(SECRET, rounds=2001) ctx.verify(SECRET, hash) ctx.verify_and_update(SECRET, hash) ctx.verify_and_update(OTHER, hash) @@ -219,7 +219,7 @@ def test_bcrypt_builtin(): bcrypt.set_backend("builtin") bcrypt.default_rounds = 10 def helper(): - hash = bcrypt.encrypt(SECRET) + hash = bcrypt.hash(SECRET) bcrypt.verify(SECRET, hash) bcrypt.verify(OTHER, hash) return helper @@ -231,7 +231,7 @@ def test_bcrypt_ffi(): bcrypt.set_backend("bcrypt") bcrypt.default_rounds = 8 def helper(): - hash = bcrypt.encrypt(SECRET) + hash = bcrypt.hash(SECRET) bcrypt.verify(SECRET, hash) bcrypt.verify(OTHER, hash) return helper @@ -242,7 +242,7 @@ def test_md5_crypt_builtin(): from passlib.hash import md5_crypt md5_crypt.set_backend("builtin") def helper(): - hash = md5_crypt.encrypt(SECRET) + hash = md5_crypt.hash(SECRET) md5_crypt.verify(SECRET, hash) md5_crypt.verify(OTHER, hash) return helper @@ -252,7 +252,7 @@ def test_ldap_salted_md5(): """test ldap_salted_md5""" from passlib.hash import ldap_salted_md5 as handler def helper(): - hash = handler.encrypt(SECRET, salt='....') + hash = handler.hash(SECRET, salt='....') handler.verify(SECRET, hash) handler.verify(OTHER, hash) return helper @@ -263,7 +263,7 @@ def test_phpass(): from passlib.hash import phpass as handler kwds = dict(salt='.'*8, rounds=16) def helper(): - hash = handler.encrypt(SECRET, **kwds) + hash = handler.hash(SECRET, **kwds) handler.verify(SECRET, hash) handler.verify(OTHER, hash) return helper @@ -273,7 +273,7 @@ def test_sha1_crypt(): from passlib.hash import sha1_crypt as handler kwds = dict(salt='.'*8, rounds=10000) def helper(): - hash = handler.encrypt(SECRET, **kwds) + hash = handler.hash(SECRET, **kwds) handler.verify(SECRET, hash) handler.verify(OTHER, hash) return helper |
