hashing.py 257 Bytes
Newer Older
Ai-Sasit's avatar
Ai-Sasit committed
1 2 3 4 5 6 7 8 9 10 11
from passlib.context import CryptContext

pwd_cxt = CryptContext(schemes =["bcrypt"],deprecated="auto")

class Hash():
    
	def bcrypt(password:str):
		return pwd_cxt.hash(password)

	def verify(hashed,plaintext):
		return pwd_cxt.verify(plaintext,hashed)