Files
common/docs/keccak.md
T
Jaco Greeff 5d0a7231dc Fix alias links (#34)
* Fix alias links

* Update alias links

* Update generated docs
2017-12-01 20:34:51 +01:00

1.3 KiB

keccak

Create Keccak256 values as hex, string & buffer output

keccakAsBuffer

Creates a keccak Buffer from the input.

keccakAsBuffer (value: Buffer | string): Buffer

From either a string or a Buffer input, create the keccak and return the result as a Buffer.

import { keccakAsBuffer } from '@polkadot/util';

console.log('asBuffer', keccakAsBuffer('123')) // => Buffer

keccakAsHex

Creates a keccak hex string from the input.

keccakAsHex (value: Buffer | string): string

From either a string or a Buffer input, create the keccak and return the result as a 0x prefixed hex string.

import { keccakAsHex } from '@polkadot/util';

console.log('asHex', keccakAsHex('123')) // => 0x...

keccakAsString

Creates a keccak string from the input.

keccakAsString (value: Buffer | string): string

From either a string or a Buffer input, create the keccak and return the result as a non-prefixed string.

import { keccakAsString } from '@polkadot/util';

console.log('asString', keccakAsString('123')) // => string