fix: below or equal in var_int encoding
This commit is contained in:
parent
4038c0273f
commit
faa002f53c
|
@ -31,9 +31,9 @@ def int_to_hex(i, length=1):
|
|||
def var_int(i):
|
||||
if i<0xfd:
|
||||
return int_to_hex(i)
|
||||
elif i<0xffff:
|
||||
elif i<=0xffff:
|
||||
return "fd"+int_to_hex(i,2)
|
||||
elif i<0xffffffff:
|
||||
elif i<=0xffffffff:
|
||||
return "fe"+int_to_hex(i,4)
|
||||
else:
|
||||
return "ff"+int_to_hex(i,8)
|
||||
|
|
Loading…
Reference in New Issue