Functions
trieRoot
▸ trieRoot(input: Array<TriePair>, codec?: Codec): Uint8Array
Defined in trieRoot.ts:29
name: trieRoot
summary: Creates a trie hash from the supplied pairs.
description: From an Array<{k: Uint8Array, v: Uint8Array}> input, calculate the triehash and return the result as a Uint8Array.
example:
import { stringToU8a } from '@polkadot/util';
import { trieRoot } from '@polkadot/trie-hash';
trieRoot([{
k: stringToU8a('A'),
v: stringToU8a('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
}]); // => 0xd23786fb4a010da3ce639d66d5e904a11dbc02746d1ce25029e53290cabf28ab
1
2
3
4
5
6
7
2
3
4
5
6
7
Parameters:
| Name | Type | Default value |
|---|---|---|
| input | Array<TriePair> | - |
Default value codec | Codec | DEFAULT_CODEC |
Returns: Uint8Array