Skip to content

fix encoding strings when length is a multiple of 128#3

Open
girst wants to merge 1 commit into
onlpx:mainfrom
fork-graveyard:main
Open

fix encoding strings when length is a multiple of 128#3
girst wants to merge 1 commit into
onlpx:mainfrom
fork-graveyard:main

Conversation

@girst
Copy link
Copy Markdown

@girst girst commented Feb 10, 2026

if the length of a string is exactly 128, the length prefix is wrongly written as 00 instead of 8001. this fixes that.

minimal reproducer:

from pyproto import ProtoBuf
print(ProtoBuf({1: "A"*128}).toBuf().hex())

before: 0a004141414141414141...
after: 0a80014141414141414141...

minimal reproducer:
  from pyproto import ProtoBuf
  print(ProtoBuf({1: "A"*128}).toBuf().hex())

before: 0a004141414141414141...
after:  0a80014141414141414141...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant