Replies: 2 comments 2 replies
-
Have you tried 1000000000000000000n? This is the JavaScript literal for a 64-bit (or more) integer. (1000000000000000000 is a float in JS.) |
Beta Was this translation helpful? Give feedback.
-
Hello @kriszyp and @jackkru69, i have a similiar issue. uint 64-bit integer shall be mapped to 0xCF .. .. .. .. .. .. .. .., but actually they are mapped to 0xD3 (if they are small enough) E.g.: bigint 1695129253235n is mapped to D30000018AAD93B573 but it could also be CF0000018AAD93B573 My expectation would be: When it is positive, use uint64 (0xCF), only when it is negative use int64 (0xd3) For my understanding the fix can be done in line 526 of pack.js by switching the two if conditions: Do you agree? |
Beta Was this translation helpful? Give feedback.
-
Hey everyone,
I'm currently working with MessagePack, and I need to encode large integers as uint64. However, I don't expect to deal with floats in my use case—I'm specifically working with integers only.
For instance, I tried packing the number 1000000000000000000 as a sum, and from what I understand, the result should be something like CF0DE0B6B3A7640000.
Could someone confirm whether the CF type in MessagePack corresponds to uint64, or if there's something I'm missing here?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions