2021-08-11 10:44:12 +00:00
|
|
|
from passlib.hash import bcrypt
|
2021-06-28 09:08:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Password:
|
|
|
|
@staticmethod
|
|
|
|
def encode(password: str) -> str:
|
2021-08-11 10:44:12 +00:00
|
|
|
return bcrypt.hash(password)
|
2021-06-28 09:08:09 +00:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def verify(password: str, other: str) -> bool:
|
2021-08-11 10:44:12 +00:00
|
|
|
return bcrypt.verify(password, other)
|