Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle int64 #17

Closed
mcollina opened this issue Feb 16, 2015 · 8 comments
Closed

Handle int64 #17

mcollina opened this issue Feb 16, 2015 · 8 comments

Comments

@mcollina
Copy link
Owner

Currently we do not support int64. I think we should do that using https://github.com/broofa/node-int64.

Any opinions?

@planetbeing
Copy link

(First, thanks for your work on this project!)

I need int64 support and I think using that library is fine. The current way that msgpack5 encodes int64 is not to spec (as of 2.0.0):

> msgpack.encode(0x1234567812345600)
<Buffer cf 24 68 ac 00 12 34 56 78>

Expected:

> msgpack.encode(0x1234567812345600)
<Buffer cf 12 34 56 78 12 34 56 00>

I ran into this problem trying to interoperate this library with https://github.com/msgpack/msgpack-javascript (probably problematic anyway besides this problem due to how dated the other project is).

I think even if approximate 64-bit values were used, the encoding of the approximate value should match that of the specification.

@mcollina
Copy link
Owner Author

Thanks for reporting! Can you please send a PR to address this problem?

@mtburt
Copy link

mtburt commented May 6, 2015

Wanted to check in and see if there is a fix for this. I found the same problem and fixed the byte order and offset issue but not using the library, just the javascript int representation. If you think the fix using the library is coming I'll wait for it, otherwise I'm happy to submit my fix.

@mcollina
Copy link
Owner Author

mcollina commented May 7, 2015

This should be already released.
Il giorno gio 7 mag 2015 alle 01:31 mtburt [email protected] ha
scritto:

Wanted to check in and see if there is a fix for this. I found the same
problem and fixed the byte order and offset issue but not using the
library, just the javascript int representation. If you think the fix using
the library is coming I'll wait for it, otherwise I'm happy to submit my
fix.


Reply to this email directly or view it on GitHub
#17 (comment).

@mcollina mcollina closed this as completed Jul 4, 2015
@rochdev
Copy link

rochdev commented Dec 15, 2017

@mcollina Just tried using this library for objects containing int64 and it doesn't seem to work.

For example:

console.log(encode(0xffffffffffffffff))
<Buffer cb 43 f0 00 00 00 00 00 00>

I would expect the buffer to be:

<Buffer cf ff ff ff ff ff ff ff ff>

@rochdev
Copy link

rochdev commented Dec 15, 2017

If you reopen this issue I could submit a PR to add support for node-int64

@mcollina
Copy link
Owner Author

Feel free to open an new issue, this one is very old.

@rochdev
Copy link

rochdev commented Dec 15, 2017

Opened #61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants