mafintosh / abstract-encoding Goto Github PK
View Code? Open in Web Editor NEWAn encoding interface for node
License: MIT License
An encoding interface for node
License: MIT License
Would be nice to have an official recommendation on optional parameters:
offset
in encode
and end
in decode
I'm thinking about following abstract-encoding
in https://github.com/ethereumjs/rlp, which has:
rlp.decode(encoded, [skipRemainderCheck=false]) - Decodes a RLP encoded Buffer, Array or String and returns a Buffer or an Array of Buffers. If skipRemainderCheck is enabled rlp will just decode the first rlp sequence in the buffer. By default it would through an error if there is more bytes in Buffer than used by rlp sequence.
Is this argument absolute to the buffer start or relative to the start argument?
EDIT: I guess end implies an absolute value, contrary to length which seems relative to me. Just want to make a note of this here for anyone else
API docs says nothing about what encode/decode should to do when buffer is too small.
Most of modules that uses this interface throwing errors (for example: buffer.readUInt32BE
could throw RangeError
), but varint has another behavior
Related issue in varint: chrisdickinson/varint#13
English isn't my native language, but wouldn't Compliant modules
is better than Modules that use this interface
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.