birchroad / node-jspack

JavaScript library to pack primitives to octet arrays, packaged for NodeJS
http://code.google.com/p/jspack/
BSD 3-Clause "New" or "Revised" License
15 stars 12 forks source link

Added support for variable length null terminated strings #1

Closed ryanrolds closed 12 years ago

ryanrolds commented 12 years ago

This uses the 'S' format character. Due to the inability to precalculate the width, 'S' doesn't work with CalcLength() or Pack(). PackTo and Unpack work fine.

ryanrolds commented 12 years ago

The CalcLength() and Pack() issues has been resolved on my fork. I have since made some major changes and reformatted a good chunk of the code and add a couple of tests. Added object/key support to unpack using "b(keyName)" in the format string. Also changed it so that Pack() allocates and returns a buffer. Some of the changes break backwards compatiblity, so I'm spinning it off as bufferpack.