I\'ve been reading up a lot on stuct.pack and hex and the like.
I am trying to convert a decimal to hexidecimal with 2-bytes. Reverse the hex bit order, then convert
>>> x = 36895 >>> ((x << 8) | (x >> 8)) & 0xFFFF 8080 >>> hex(x) '0x901f' >>> struct.unpack('H',x))[0] 8080 >>> hex(8080) '0x1f90'