MiniTLV - TLV inspired binary protocol.
- Header byte: Length([8:tagBits]) Tag([tagBits:0])
- Rest bytes: Value array
Install from NPM:
$ npm install mtlv --save
const mtlv = new MTLV();
const packet = mtlv.encode(0x1, [0x2, 0x4]);
const { tag, length, value } = mtlv.decode(packet));
const parser = new MTLVParser();
const { tag, length, value } = parser.parse([0x21, 0x2, 0x4]);