data endian is not correct
Opened this issue · 0 comments
xbd119 commented
should add '>' to make encoding as big endian. otherwise the binn-c will get wrong data.
if value < 0x10000:
self._buffer.write(types.BINN_UINT16)
self._buffer.write(pack('>H', value))
return
# unsigned int
if value < 0x100000000:
self._buffer.write(types.BINN_UINT32)
self._buffer.write(pack('>I', value))
return
# unsigned long
if value < 0x10000000000000000:
self._buffer.write(types.BINN_UINT64)
self._buffer.write(pack('>Q', value))
return