A encoding interface for node
[](https://github.com/mafintosh/abstract-encoding)
buffer = encoding.encode(obj, [buffer], [offset])
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.
obj = encoding.decode(buffer, [start], [end])
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
length = encoding.encodingLength(obj)
Should return the amount of bytes needed to encode obj
.
MIT
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4