pyrit.identifiers.config_hash

Contents

pyrit.identifiers.config_hash#

config_hash(config_dict: dict[str, Any]) str[source]#

Compute a deterministic SHA256 hash from a config dictionary.

This is the single source of truth for identity hashing across the entire system. The dict is serialized with sorted keys and compact separators to ensure determinism.

Parameters:

config_dict (Dict[str, Any]) – A JSON-serializable dictionary.

Returns:

Hex-encoded SHA256 hash string.

Return type:

str

Raises:

TypeError – If config_dict contains values that are not JSON-serializable.