implemented postgres support in repositories

This commit is contained in:
Brian Bjarke Jensen
2025-11-11 18:52:19 +01:00
parent 65655db034
commit e7ed89e04e
31 changed files with 364 additions and 236 deletions
+17
View File
@@ -0,0 +1,17 @@
"""Definition of hash_password function."""
import bcrypt
def hash_password(password: str) -> str:
"""Hash a password using bcrypt.
Args:
password: Plain text password to hash
Returns:
Hashed password as a string
"""
salt = bcrypt.gensalt()
hashed: bytes = bcrypt.hashpw(password.encode("utf-8"), salt)
return hashed.decode("utf-8")