abstract-encoding
abstract-encoding copied to clipboard
Optional parameters in decode/encode
Would be nice to have an official recommendation on optional parameters:
- should they be discouraged
- should they be after
offsetinencodeandendindecode - any other option?
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.