TM_RAG_Chatbot_Demo / password_generator.py
BMCVRN's picture
pr2 (#2)
170ac2b verified
raw
history blame
470 Bytes
import hashlib
import getpass
def generate_password_hash():
"""Generate a SHA-256 hash for a password"""
password = getpass.getpass("Enter the password you want to hash: ")
if not password:
print("Password cannot be empty")
return
hashed = hashlib.sha256(password.encode()).hexdigest()
print("\nAdd the following line to your .env file:")
print(f"PASSWORD={hashed}")
if __name__ == "__main__":
generate_password_hash()