rlp
- Version 3.0.0
- Published
- 49.7 kB
- No dependencies
- MPL-2.0 license
Install
npm i rlp
yarn add rlp
pnpm add rlp
Overview
Recursive Length Prefix Encoding Module
Index
Variables
Functions
Interfaces
Type Aliases
Variables
Functions
function bytesToHex
bytesToHex: (uint8a: Uint8Array) => string;
function concatBytes
concatBytes: (...arrays: Uint8Array[]) => Uint8Array;
Concatenates two Uint8Arrays into one.
function decode
decode: { (input: Input, stream?: false): Uint8Array | NestedUint8Array; (input: Input, stream?: true): Decoded;};
RLP Decoding based on https://eth.wiki/en/fundamentals/rlp
Parameter input
Will be converted to Uint8Array
Parameter stream
Is the input a stream (false by default)
Returns
decoded Array of Uint8Arrays containing the original message
function encode
encode: (input: Input) => Uint8Array;
RLP Encoding based on https://eth.wiki/en/fundamentals/rlp This function takes in data, converts it to Uint8Array if not, and adds a length for recursion.
Parameter input
Will be converted to Uint8Array
Returns
Uint8Array of encoded data
function hexToBytes
hexToBytes: (hex: string) => Uint8Array;
function utf8ToBytes
utf8ToBytes: (utf: string) => Uint8Array;
Interfaces
Type Aliases
type Input
type Input = string | number | bigint | Uint8Array | Array<Input> | null | undefined;
type NestedUint8Array
type NestedUint8Array = Array<Uint8Array | NestedUint8Array>;
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (12)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/rlp
.
- Markdown[](https://www.jsdocs.io/package/rlp)
- HTML<a href="https://www.jsdocs.io/package/rlp"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1035 ms. - Missing or incorrect documentation? Open an issue for this package.