* Expand util-crypto test coverage * Add @polkadot/util-triehash * Update link to util-triehash
451 B
451 B
util
Internal utilities used along with hash generation
- asNibbles Converts the input to Nibbles.
asNibbles
Converts the input to Nibbles.
asNibbles (pairs: Trie$Pairs): Uint8Array
From an Uint8Array input, calculate and return a list of nibbles that makes up the input.
import { asNibbles } from '@polkadot/util-triehash/util';
asNibbles(new Uint8Array([0x41, 0x20]) // => Uint8Array([4, 1, 2, 0])