Spaces:
Runtime error
Runtime error
Refactor Dockerfile and clean up unused schemas; update Redis client initialization and environment configuration
a3aa6c1 Download src/utils/_bcrypt_util.py from sifars/keepme-backend: direct link, hf CLI and curl.
- Browser
- Download file 535 Bytes
-
https://huggingface.co/spaces/sifars/keepme-backend/resolve/main/src/utils/_bcrypt_util.py
- Command line
-
hf download hf://spaces/sifars/keepme-backend/src/utils/_bcrypt_util.py
-
curl -L -o _bcrypt_util.py https://huggingface.co/spaces/sifars/keepme-backend/resolve/main/src/utils/_bcrypt_util.py
535 Bytes
| import bcrypt | |
| class BcryptUtil: | |
| def hash_password(password: str) -> str: | |
| salt = bcrypt.gensalt() | |
| hashed_password = bcrypt.hashpw(password.encode("utf-8"), salt) | |
| return hashed_password.decode("utf-8") | |
| def compare_password(stored_password: str, provided_password: str) -> bool: | |
| stored_password = stored_password.encode("utf-8") | |
| provided_password = provided_password.encode("utf-8") | |
| return bcrypt.checkpw(provided_password, stored_password) | |