abstract-encoding
abstract-encoding copied to clipboard
small buffer
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: https://github.com/chrisdickinson/varint/pull/13
cc @chrisdickinson
ah. yea if you cannot encode the value it should throw. we should put that in the "spec".