Recursive bytearray hash function
ISTR that type(x) is relatively slow.  Try saving it in a local variable:

typev = type(v)
if typev is list and len(v) == 1:
        isSingleElementList = True

if typev is not list or isSingleElementOfList:   # if v is a single element
    v0 = v[0] if isSingleElementOfList else v

    type_v0 = type(v0)
    if type_v0 is bytearray or v0.__class__.__name__ == 'bytes':
        return hash(v0)
    if type_v0 is int:
       return hash(ToByteArray(v0))
    if type_v0 is str:
        return hash(v0.encode('utf-8'))       
else:                               # if v is a list
    res = bytearray()
    for vi in v:
        res +=  RecHash(vi)     # recursion
    return hash(res)            # hash the concatenated hashes


Also, btw, your code will choke on nested single element lists. Consider [[[1]]]