import hashlib


def hash_api_key(key: str) -> str:
    """
    Hash an API key using SHA256.

    :param key: the API key to hash
    :return: the hashed key

    """
    return hashlib.sha256(key.encode("utf-8")).hexdigest()