Introduce @polkadot/util-rlp (#76)

* Add toU8a conversions

* Add u8a utilities

* @polkadot/rlp with encoding

* Decoding test runthrough

* Update util locations

* Convert util-triehash to use util-rlp

* Allow keccak from Uint8Array

* Pass Uint8Array to keccak input

* Update documentation

* Skip some doc generation

* Update @polkadot/dev

* Update doc typo

* Update allocations

* Retrieve tests from ethereumjs-testing

* Simplify test retrieval

* Exclude etereumjs-testing from flow
This commit is contained in:
Jaco Greeff
2018-02-08 14:50:54 +01:00
committed by GitHub
parent a18e7f8474
commit e832aebb07
64 changed files with 1073 additions and 188 deletions
+19
View File
@@ -0,0 +1,19 @@
// Copyright 2017-2018 Jaco Greeff
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
// @flow
const encoder = require('./encoder');
/**
@name encode
@signature encode (input: any): Uint8Array
@summary Encodes the input value into RLP.
@description
From an input, calculate the RLP and return the result as a `Uint8Array`.
@example
import { encode } from '@polkadot/util-rlp';
encode('dog') // => [0x83, 0x64, 0x6f, 0x67]
*/
module.exports = encoder;