def calcHash(buf):
global _nhash
#buf = b"\x61\x24\x7f\xbf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
buf = list(bytearray(buf))
#print buf
num_bytes = len(buf)
array_type = ctypes.c_ubyte * num_bytes
data = _nhash.compute_hash(array_type(*buf), ctypes.c_uint32(num_bytes));
#print data
return ctypes.c_uint64(data).value
评论列表
文章目录