Assuming a Python environment for simplicity:

import hashlib import os

def hash_password(password): # Simple example using SHA-256, but consider more secure options return hashlib.sha256(password.encode()).hexdigest()