import hashlib
import json


def hash_object(obj):
    """deterministically hash a dict."""
    hash = hashlib.sha256()
    hash.update(json.dumps(obj, sort_keys=True).encode("utf-8"))
    return hash.hexdigest()