int24
int24 is a simple utility library for serializing 24-bit integers.
Why is this useful?
A really good question. Probably not very useful to most people. I needed this for work I'm doing in Node.js with the Hadoop Writable serialization (e.g. VLong), so I figured I'd share what I used.
Example
var int24 = ; var buf = 3; // 3 byte Bufferint24; // writes out 0xFFFFFF to the buffer at offset 0 var val;var buf = 0x01 0x02 0x03;val = int24; // 197121val = int24; // 66051
Install
npm install int24
Tests
npm test
License
MIT License