Download src/utils/password.py from kbl2810/test: direct link, hf CLI and curl.
- Browser
- Download file 407 Bytes
-
https://huggingface.co/spaces/kbl2810/test/resolve/main/src/utils/password.py
- Command line
-
hf download hf://spaces/kbl2810/test/src/utils/password.py
-
curl -L -o password.py https://huggingface.co/spaces/kbl2810/test/resolve/main/src/utils/password.py
407 Bytes
| # import bcrypt | |
| # class PasswordUtils: | |
| # @staticmethod | |
| # def hash_password(password: str) -> str: | |
| # hashed = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt()) | |
| # return hashed.decode('utf-8') | |
| # @staticmethod | |
| # def check_password(password: str, hashed_password: str) -> bool: | |
| # return bcrypt.checkpw(password.encode('utf-8'), hashed_password.encode('utf-8')) | |