import hashlib from passlib.context import CryptContext pwd_context = CryptContext(schemes=['bcrypt'], deprecated='auto') # 先SHA256再bcrypt password = 'admin123' sha256_hash = hashlib.sha256(password.encode()).hexdigest() print(f"SHA256: {sha256_hash}") print(f"bcrypt: {pwd_context.hash(sha256_hash)}")