Closed derekpa closed 1 year ago
Why not use the full byte capacity or the first one byte option, selecting values < 0xfd instead of < 0x100?
Thanks.
if i < 0x100: return bytes([i]) elif i < 0x10000: return b'\xfd' + int_to_little_endian(i, 2)
instead of
if i < 0xfd: return bytes([i]) elif i < 0x10000: return b'\xfd' + int_to_little_endian(i, 2)
OK, I assume its because 0xfd to 0xff are used as flags. Makes sense.
Why not use the full byte capacity or the first one byte option, selecting values < 0xfd instead of < 0x100?
Thanks.
if i < 0x100: return bytes([i]) elif i < 0x10000: return b'\xfd' + int_to_little_endian(i, 2)
instead of
if i < 0xfd: return bytes([i]) elif i < 0x10000: return b'\xfd' + int_to_little_endian(i, 2)