This patch adds support for signed int64 encoding and decoding.
Some potential flags I'm aware of:
1) The two's complement code is based off of the implementation from node-int64. This is MIT-licensed so would be compatible. The relevant code could also be replaced with an alternate implementation, I just haven't had time to do that yet.
2) The decoder does not validate that the decoded int64 is in the Number.MIN_SAFE_INTEGER..Number.MAX_SAFE_INTEGER range. It would be potentially nice to do that and throw a decode exception, but was not necessary for my use case.
I have tested this pull request just a moment ago, and that fix should definitely become official.
Meanwhile, I took the advice of making sure that the number lies in the safe range here.
This patch adds support for signed int64 encoding and decoding.
Some potential flags I'm aware of:
1) The two's complement code is based off of the implementation from node-int64. This is MIT-licensed so would be compatible. The relevant code could also be replaced with an alternate implementation, I just haven't had time to do that yet.
2) The decoder does not validate that the decoded int64 is in the Number.MIN_SAFE_INTEGER..Number.MAX_SAFE_INTEGER range. It would be potentially nice to do that and throw a decode exception, but was not necessary for my use case.
Thanks! Matthew