encode to bytes

This commit is contained in:
Christian Hagenest
2024-06-06 00:13:23 +02:00
committed by missytake
parent 9be0408ab8
commit 3f4989223d

View File

@@ -23,7 +23,7 @@ class UnknownCommand(ValueError):
def encrypt_password(password: str):
# https://doc.dovecot.org/configuration_manual/authentication/password_schemes/
passhash = hashlib.sha512(password).hexdigest()
passhash = hashlib.sha512(password.encode('UTF-8')).hexdigest()
return "{SHA512-CRYPT}" + passhash