25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

17 satır
374 B

  1. import bcrypt
  2. from passlib.context import CryptContext
  3. pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
  4. def generate_salt():
  5. return bcrypt.gensalt().decode()
  6. def verify_password(plain_password, hashed_password):
  7. return pwd_context.verify(plain_password, hashed_password)
  8. def get_password_hash(password):
  9. return pwd_context.hash(password)