Files
common/packages/util-rlp/src/encode.js
T
Jaco Greeff e832aebb07 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
2018-02-08 14:50:54 +01:00

20 lines
547 B
JavaScript

// 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;