You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
derekpa
changed the title
function encode_varint use one byte strings for values < 0xfd instead of < 0xff
Chapter 5 function encode_varint use one byte strings for values < 0xfd instead of < 0xff
Oct 5, 2023
derekpa
changed the title
Chapter 5 function encode_varint use one byte strings for values < 0xfd instead of < 0xff
Chapter 5 function encode_varint Why use < 0xfd instead of < 0x100 for one byte strings, similar to the larger options?
Oct 5, 2023
derekpa
changed the title
Chapter 5 function encode_varint Why use < 0xfd instead of < 0x100 for one byte strings, similar to the larger options?
Chapter 5: In function encode_varint - Why use < 0xfd instead of < 0x100 for one byte strings, similar to the larger options?
Oct 5, 2023
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)
The text was updated successfully, but these errors were encountered: