Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is a value I take from the pidev-server log:
- from argon2 import PasswordHasher
- ph = PasswordHasher()
- print("Test as string")
- hash='$argon2i$v=19$m=102400,t=2,p=8$NSYEwHiP0VoLQQgBAKD0Pg$Tg493ikpeaglkoFmG5AdYw'
- print("check: %s of type:%s" % (ph.check_needs_rehash(hash), type(hash)))
- print("Test as bytes")
- hash=b'$argon2i$v=19$m=102400,t=2,p=8$NSYEwHiP0VoLQQgBAKD0Pg$Tg493ikpeaglkoFmG5AdYw'
- print("check: %s of type:%s" % (ph.check_needs_rehash(hash), type(hash)))
- Result:
- Test as string
- check: True of type:<class 'str'>
- Test as bytes
- Traceback (most recent call last):
- File "arg1-test.py", line 11, in <module>
- print("check: %s of type:%s" % (ph.check_needs_rehash(hash), type(hash)))
- File "/home/devpi/piserv/lib/python3.7/site-packages/argon2/_password_hasher.py", line 212, in check_needs_rehash
- return self._parameters != extract_parameters(hash)
- File "/home/devpi/piserv/lib/python3.7/site-packages/argon2/_utils.py", line 163, in extract_parameters
- parts = hash.split("$")
- TypeError: a bytes-like object is required, not 'str'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement