reason-rlp
[Recursive Length](https://github.com/ethereum/wiki/wiki/RLP) prefix encoding implementation in Reason.
Last updated 3 years ago by figitaki .
MIT · Original npm · Tarball · package.json
$ cnpm install reason-rlp 
SYNC missed versions from official npm registry.

Recursive Length Prefix Encoding

Recursive Length prefix encoding implementation in Reason.

Install

npm install reason-rlp

Install with -g if you want to use the cli.

Usage

var RLP = require('reason-rlp');
var assert = require('assert');

var nestedList = [ [], [[]], [ [], [[]] ] ]; /* Set theoretic representation of 3 */
var encoded = RLP.encode(nestedList);
var decoded = RLP.decode(encoded);
assert.deepEquals(nestedList, decoded);

API

rlp.encode(plain) - RLP encoded an Array, Buffer or String and returns a Buffer WIP rlp.decode(encoded, [skipRemainderCheck=false]) - Decodes an 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 the rlp sequence.

Tests

Tests use mocha. To run npm test

Current Tags

  • 0.1.0-alpha.1                                ...           latest (3 years ago)

1 Versions

  • 0.1.0-alpha.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |