Download scripts/check_hashing.py from Mohansree/bsure-api: direct link, hf CLI and curl.
- Browser
- Download file 417 Bytes
-
https://huggingface.co/spaces/Mohansree/bsure-api/resolve/main/scripts/check_hashing.py
- Command line
-
hf download hf://spaces/Mohansree/bsure-api/scripts/check_hashing.py
-
curl -L -o check_hashing.py https://huggingface.co/spaces/Mohansree/bsure-api/resolve/main/scripts/check_hashing.py
417 Bytes
| from passlib.context import CryptContext | |
| try: | |
| pwd_context = CryptContext(schemes=["pbkdf2_sha256"], deprecated="auto") | |
| print("Context created") | |
| hash = pwd_context.hash("password123") | |
| print(f"Hash created: {hash}") | |
| verify = pwd_context.verify("password123", hash) | |
| print(f"Verify result: {verify}") | |
| except Exception as e: | |
| import traceback | |
| traceback.print_exc() | |
| print(f"Error: {e}") | |