d = {'url_params': {'id': 'baar', 'namespace': 'foo'}, 'req_params': {'app':
    '12345', 'format': 'json'}, 'url_id': 'rest'}
ha = hashlib.sha256(json.dumps(a)).hexdigest()
hb = hashlib.sha256(json.dumps(b)).hexdigest()
hc = hashlib.sha256(json.dumps(c)).hexdigest()
hd = hashlib.sha256(json.dumps(d)).hexdigest()
assert ha == hb
assert ha == hc
assert ha == hd
How to generate unique equal hash for equal dictionaries?