Files
common/packages/util-triehash/docs/util.md
T
Jaco Greeff 6b3be0bc30 Introduce @polkadot/util-triehash (#75)
* Expand util-crypto test coverage

* Add @polkadot/util-triehash

* Update link to util-triehash
2018-02-07 13:41:45 +01:00

22 lines
451 B
Markdown

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