mtlv

0.0.3 • Public • Published

mtlv

MiniTLV - TLV inspired binary protocol.

Packet layout

  • Header byte: Length([8:tagBits]) Tag([tagBits:0])
  • Rest bytes: Value array

Installation

Install from NPM:

$ npm install mtlv --save

Examples

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]);

Readme

Keywords

Package Sidebar

Install

npm i mtlv

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

6.45 kB

Total Files

7

Last publish

Collaborators

  • dotcypress