def _get_hash(obj):
    obj_type = type(obj)
    if obj_type is dict:
        hash_list = []
        for k in sorted(obj):
            hash_list.append(_get_hash(k).hexdigest())
            hash_list.append(_get_hash(obj[k]).hexdigest())
        seed = ''.join(hash_list)
    elif obj_type is list:
        hash_list = []
        for item in obj:
            hash_list.append(_get_hash(item).hexdigest())
        seed = ''.join(hash_list)
    elif obj_type is bool:
        seed = str(obj).lower()
    elif obj_type is float:
        seed = repr(obj)
    elif obj is None:
        seed = 'null'
    else:
        seed = str(obj)
    return SHA512.new(seed.encode('utf-8'))
Returns a SHA512 object for the given object. Works in a similar fashion
dataset/ETHPy150Open ntoll/p4p2p/p4p2p/dht/crypto.py/_get_hash