Files
common/packages/util-crypto/docs/blake2.md
T
Jaco Greeff 523dc1c48d Update hashing functions to ref (#68)
* Package upgrades

* Use h64 by default

* Remove AsNumber distinction

* xxhash32/64 & blake2b/2s

* Add xxhashAsHex{128,256}

* Add blake2AsHex{128,256,512}

* Update documentation

* Update docs
2018-01-30 11:55:32 +01:00

1.7 KiB

blake2

Create blake2b values with specified bitlengths

blake2AsHex

Creates a blake2b hex from the input.

blake2AsHex (data: Uint8Array, bitLenght: number = 64): string

From a Uint8Array input, create the blake2b and return the result as a hex string with the specified bitLength.

import { blake2AsHex } from '@polkadot/util-crypto';

blake2AsHex('abc')) // => 0xba80a53f981c4d0d

blake2AsHex128

Creates a blake2b hex with 128-bits from the input.

blake2AsHex128 (data: Buffer): string

From a Uint8Array input, create the blake2b and return the result as a hex string with 128 bits.

import { blake2AsHex128 } from '@polkadot/util-crypto';

blake2AsHex128('abc')) // => 0x44bc2cf5ad770999

blake2AsHex256

Creates a blake2b hex with 256-bits from the input.

blake2AsHex256 (data: Buffer): string

From a Uint8Array input, create the blake2b and return the result as a hex string with 256 bits.

import { blake2AsHex256 } from '@polkadot/util-crypto';

blake2AsHex256('abc')) // => 0x44bc2cf5ad770999

blake2AsHex512

Creates a blake2b hex with 512-bits from the input.

blake2AsHex512 (data: Buffer): string

From a Uint8Array input, create the blake2b and return the result as a hex string with 512 bits.

import { blake2AsHex512 } from '@polkadot/util-crypto';

blake2AsHex512('abc')) // => 0x44bc2cf5ad770999