Open
Conversation
-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
pointed by msgpack/website#19
This was referenced Jun 24, 2019
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.