-
Notifications
You must be signed in to change notification settings - Fork 131
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
Implement MessagePack timestamp extension #87
Comments
Yes, I've been working for it. I'll retry to merge it in this month. |
I've just stumbled across this as well, in my very first experiments with this. It doesn't seem easy to decode that 30/34 bit structure in JavaScript without putting almost every bit manually where it belongs. Do you have any code public to have a look at it while I'm writing a workaround? Update: This seems to work for 8-byte-values: (I have only checked it down to the seconds)
|
Revisited this. Here's my code that should be able to decode all three timestamp formats. It only handles a single value deserialised from MessagePack. It needs to be integrated into the deserialiser to work transparently on all data. JavaScript can be a beast when it comes to numeric data. Hence all the funny extra bitwise operators and DWORD pairs in there. Learned a thing or two today. I'm currently writing my own little MessagePack codec in JavaScript. The encoder is complete as of today (incl. timestamp support) and has only 250 loc. The whole thing should reach 1/10th of the size of this library. I can't say anything about its performance yet though.
(Warning: I have rearranged this code for showing it here. This exact code is untested.) |
Just for information and maybe a reference implementation, I have now published my MessagePack codec for JavaScript: https://github.com/ygoe/msgpack.js |
The MessagePack has for a while now had a built-in timestamp extension: https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type
Are there any plans to implement the timestamp format? I'd be especially excited about the 0xc7 version.
The text was updated successfully, but these errors were encountered: