import json
import hashlib


def dict2hash(obj):
    """Calculate a hash value for a dictionary."""
    adjson = json.dumps(obj, sort_keys=True, default=str)
    m = hashlib.md5()
    m.update(adjson.encode())
    _hash = m.hexdigest()
    print(f"adjson={adjson}")
    print(f"_hash={_hash}")
    return _hash