import hashlib


def hash_dict(context):
    """Convert a SHA256 hash for a Python dictionary of strings."""
    hash = hashlib.sha256()
    for key in sorted(context.keys()):
        hash.update(bytes(key, encoding="utf-8"))
        hash.update(bytes(context[key], encoding="utf-8"))
    return hash.hexdigest()