I'm trying to replicate the Perl and PHP style pack and unpack functions in JavaScript.
Unsigned integers were easy enough, so my pack('n') and pack('N') are ok. But my lack of a puter science background is a hurdle now and I don't know where to start with pack('d') for packing JavaScript's standard floating point.
Is there a JavaScript library for this out there?
If not, is there a good resource where I can learn how to do this? I am fine with bitwise and binary level operations in JS, I just don't know where to start with the logic.
Thanks.
I'm trying to replicate the Perl and PHP style pack and unpack functions in JavaScript.
Unsigned integers were easy enough, so my pack('n') and pack('N') are ok. But my lack of a puter science background is a hurdle now and I don't know where to start with pack('d') for packing JavaScript's standard floating point.
Is there a JavaScript library for this out there?
If not, is there a good resource where I can learn how to do this? I am fine with bitwise and binary level operations in JS, I just don't know where to start with the logic.
Thanks.
Share Improve this question asked Mar 18, 2010 at 8:35 Tim WhitlockTim Whitlock 1,1119 silver badges17 bronze badges1 Answer
Reset to default 7Here is an existing solution: http://phpjs/functions/pack:880
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745317711a4622294.html
评论列表(0条)