"""Provider-independent exact identities for tag governance."""

import hashlib
import json


def identity_hash(*parts: str) -> str:
    """Hash a length-safe tuple without altering case, whitespace or Unicode."""
    encoded = json.dumps(parts, ensure_ascii=False, separators=(",", ":"))
    return hashlib.sha256(encoded.encode("utf-8")).hexdigest()
