Skip to content

Conversation

@pierre-vigier
Copy link

The online Try! functionality is packing -128, -32768, -2147483648 differently than other implementation.

-128 with the online tool is encoded as "d1 ff 80" where as other implementation encode -128 to "d0 80" (i checked implementation in python, ruby, javascript from the implementation list plus the perl implementation)
When unpacking, both "d1 ff 80" and "d0 80" are decoded as -128, however, as "d0 80" is one byte less, i guess it should be the correct implementation.
From the specification however, i was not able to confirm which one is the correct one.

-128, -32768, -2147483648 are encoded differently
than other engine, and not consistenly with -32
gfx added a commit to msgpack/msgpack-javascript that referenced this pull request Jun 24, 2019
@Sainan
Copy link

Sainan commented Jun 1, 2025

lol, I noticed this myself and was gonna try to fix it... just to find a 9 year old PR.

Both encodings are correct, however. It's just that the website choses a suboptimal encoding for those specific values.

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.

2 participants