A encoding interface for node
[![abstract-encoding](https://img.shields.io/badge/abstract--encoding-compliant-brightgreen.svg?style=flat)](https://github.com/mafintosh/abstract-encoding)
Should encode an object into a buffer. If a buffer is passed as the second argument the object should be encoded into that buffer. Otherwise a new buffer should be allocated. If an offset is passed as the third argument the object should be encoded at that byte offset. The byte offset defaults to 0
After encoding encoding.encode.bytes
should be set to the amount of
bytes used to encode the object.
Should decode an object from a buffer. If a start-offset is passed as the second argument the object should be decoded from that byte offset. The start-offset defaults to 0
. An end-offset can be passed as the third argument specifying at which byte to end the decoding (not including the byte at the end-offset). The end defaults to buffer.length
.
After decoding encoding.decode.bytes
should be set to the amount of bytes used to decode the object
Should return the amount of bytes needed to encode obj
.
- protocol-buffers
- varint
- varuint-bitcoin
- ip-packet
- varstruct
- varstruct-match
- objectstruct
- mdns-txt
- base64-emoji
- uint64be
- uint48be
- mp4-box-encoding
- bencode
- bencode.js
- bitfield-rle
- ipv4-peers
- rlp-encoding
- buffer-json-encoding
MIT