11 lines
286 B
Python
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) |