users api done

This commit is contained in:
andrei-mihnea-cerbu
2024-01-09 03:06:03 +02:00
parent 6ece0f37b1
commit f80b8c38db
35 changed files with 221 additions and 11 deletions
@@ -0,0 +1,11 @@
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)