diff --git a/libreauth/password.py b/libreauth/password.py index ddfc72a..6882aad 100644 --- a/libreauth/password.py +++ b/libreauth/password.py @@ -63,10 +63,7 @@ class LibreAuthPassError(Exception): else: self.message = 'unknown error' -def password_hash(password): - return password_hash_standard(password, NOSTANDARD) - -def password_hash_standard(password, standard): +def password_hash(password, standard=NOSTANDARD): pass_len = len(password) if pass_len < PASSWORD_MIN_LEN: raise LibreAuthPassError(1) diff --git a/tests/test_password.py b/tests/test_password.py index c79bb79..a26895b 100644 --- a/tests/test_password.py +++ b/tests/test_password.py @@ -45,7 +45,7 @@ class PasswordTestCase(unittest.TestCase): def test_std(self): p = b'my super password' for std in (NOSTANDARD, NIST80063B, ): - h = password_hash_standard(p, NIST80063B) + h = password_hash(p, standard=std) self.assertTrue(h.startswith('$')) self.assertEqual(len(h.split('$')), 5) self.assertTrue(is_valid(p, h))