users api done
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user