Closed sgerace closed 9 years ago
@sgerace thanks for finding this out! :) It's really hard to get all edge cases correct.
Would you mind sending in a PR?
@mcollina No problem, I'm actually writing a validator for MessagePack at the moment so I totally appreciate how many edge cases there are ;-)
The pull request is up (#37).
If you attempt to encode the value
4294967295
, it encodes it as a uint64 instead of uint32.Here is a minimal example:
When it should encode it as
ceffffffff
Quickly glancing at the code, it looks like the issue is probably coming from https://github.com/mcollina/msgpack5/blob/master/lib/encoder.js#L96 where I believe it should read:
(notice the equal to on the comparison).
I'd be happy to put together a pull request if it would help.