I'm generating a argon2d hash and wanted to compare it with hashstring from my database.
For hashing I use this function:
import argon2
argon2Hasher = argon2.hash_password_raw(b"password", b"TESTTESTTESTTEST" ,time_cost=16, memory_cost=512, parallelism=1, hash_len=16, type=argon2.Type.D) #argon2.low_level.Type.D)
print(argon2Hasher)
And my output is:
b'\x0c\xd1\xe3\xf0\x0f\x03<\xa0\xa99\xee\x85I\xc8\xcb\xb0'
I tried to use argon2Hasher.decode(encoding="ascii")
which resulted in:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 1: ordinal not in range(128)
And I also tried the same command with encoding="utf-8"
but this resulted in UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 1: invalid continuation byte
How can I convert it into plaintext (normal String)?
I'm using Python 3.6.