Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /HKUDS_LightRAG /lightrag /tools /hash_password.py
| import argparse | |
| import getpass | |
| from lightrag.api.passwords import hash_password | |
| def build_parser() -> argparse.ArgumentParser: | |
| parser = argparse.ArgumentParser( | |
| description="Generate a bcrypt password value for AUTH_ACCOUNTS." | |
| ) | |
| parser.add_argument( | |
| "password", | |
| nargs="?", | |
| help="Password to hash. If omitted, a secure prompt is used.", | |
| ) | |
| parser.add_argument( | |
| "--username", | |
| help="Optional username. When provided, output is ready to paste into AUTH_ACCOUNTS.", | |
| ) | |
| return parser | |
| def main(argv: list[str] | None = None) -> int: | |
| parser = build_parser() | |
| args = parser.parse_args(argv) | |
| password = args.password or getpass.getpass("Password: ") | |
| if not password: | |
| parser.error("password cannot be empty") | |
| hashed_password = hash_password(password) | |
| if args.username: | |
| print(f"{args.username}:{hashed_password}") | |
| else: | |
| print(hashed_password) | |
| return 0 | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |
Xet Storage Details
- Size:
- 1.03 kB
- Xet hash:
- a925011d0a74a82ba206075c9a708ed99a28eb7c306559bd1d7e3e91e4de79b4
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.