OverflowError
Python int too large to convert to C long
File "H:\spinal code cloud\程序\spinal codes_ver3.7_an\A_Lookup3.py", line 17, in lookup3Init
lookup3array = np.array([0xdeadbeef + val] * 3, dtype=np.uint32)
File "H:\spinal code cloud\程序\spinal codes_ver3.7_an\A_Hash.py", line 29, in hash_func
hash_state = lookup3Init(s)
File "H:\spinal code cloud\程序\spinal codes_ver3.7_an\A_Encoder.py", line 80, in init
spine_value = hash_func(spine_value, block)
File "H:\spinal code cloud\程序\spinal codes_ver3.7_an\A_Spinal.py", line 82, in
encoder = Encoder(k, map_func, message)
def lookup3Init(val):
lookup3array = np.array([0xdeadbeef + val] * 3, dtype=np.uint32) #这里有问题
lookup3list = list(lookup3array)
return lookup3list
def lookup3Update(state, data):
def rot(x,k):
return (((x) << (k)) | ((x) >> (32-(k)))) #
state[1] += data
state[2] ^= state[1] #这里有问题
state[2] -= rot(state[1],14)
state[0] ^= state[2]
state[0] -= rot(state[2],11)
state[1] ^= state[0]
state[1] -= rot(state[0],25)
state[2] ^= state[1]
state[2] -= rot(state[1],16)
state[0] ^= state[2]
state[0] -= rot(state[2],4)
state[1] ^= state[0]
state[1] -= rot(state[0],14)
state[2] ^= state[1]
state[2] -= rot(state[1],24)
return state