MODULE = "IMG"
def xcrc32(buf):
- return (0xffffffff - zlib.crc32(buf, 0xffffffff)).to_bytes(4, 'big')
+ return (0xffffffff - zlib.crc32(buf, 0xffffffff)).to_bytes(4, byteorder='big')
def encode_model(model):
map = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-"
head[0:4] = int(belkin_header, 0).to_bytes(4, 'big')
head[8:12] = int(time.time()).to_bytes(4, 'big')
- head[12:16] = len(buf).to_bytes(4, 'big')
+ head[12:16] = len(buf).to_bytes(4, byteorder='big')
head[24:28] = xcrc32(buf)
- head[28:29] = VERSION1.to_bytes(1)
- head[29:30] = VERSION2.to_bytes(1)
- head[30:31] = VERSION3.to_bytes(1)
- head[31:32] = VERSION4.to_bytes(1)
+ head[28:29] = VERSION1.to_bytes(1, byteorder='big')
+ head[29:30] = VERSION2.to_bytes(1, byteorder='big')
+ head[30:31] = VERSION3.to_bytes(1, byteorder='big')
+ head[31:32] = VERSION4.to_bytes(1, byteorder='big')
head[16:16 + len(COMPANY)] = bytes(COMPANY,'ascii')
mod = MODULE + "-{:1d}.{:02d}.{:02d}.{:02d}".format(VERSION1, VERSION2, VERSION3, VERSION4)