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