mardi 7 avril 2015

How to read Double from UInt64 on node.js Buffer?

I want to read an UInt64BE and convert it to Double. How can I do that?


I convert Double to UInt64BE as following:



var time = Date.now();
buffer.writeUInt32BE(parseInt(time / 0xffffffff, 10), 0);
buffer.writeUInt32BE(parseInt(time & 0xffffffff, 10), 4);

Aucun commentaire:

Enregistrer un commentaire