Skip to main content

hash_object

No overview available.

def hash_object(
obj: Any
) - > string

Generates a deterministic SHA-256 hash string for any JSON-serializable Python object. This is useful for creating unique cache keys or identifying data changes by ensuring consistent key ordering during serialization.

Parameters

NameTypeDescription
objAnyThe JSON-serializable Python object (dictionary, list, string, etc.) to be hashed.

Returns

TypeDescription
stringA 64-character hexadecimal SHA-256 hash representing the input object.