Files
FACULTATE-MESSENGER/messenger_app/api/v1/dependencies/security.py
T
2024-01-09 03:06:03 +02:00

11 lines
286 B
Python

import bcrypt
def hash_password(password):
salt = bcrypt.gensalt()
hashed_password = bcrypt.hashpw(password.encode('utf-8'), salt)
return hashed_password
def verify_password(password, hashed_password):
return bcrypt.checkpw(password.encode('utf-8'), hashed_password)