* Use js-sha3 instead of keccak * Remove exposed toBuffer from util-crypto * Add definiton for js-sha3 * Remove Buffer from docs * Cleanup crypto hashing * Cleanup interface
895 B
895 B
keccak
Create Keccak256 values as hex & Uint8Array output
- keccakAsHex Creates a keccak hex string from the input.
- keccakAsU8a Creates a keccak Uint8Array from the input.
keccakAsHex
Creates a keccak hex string from the input.
keccakAsHex (value: Buffer | Uint8Array | 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-crypto';
keccakAsHex('123') // => 0x...
keccakAsU8a
Creates a keccak Uint8Array from the input.
keccakAsU8a (value: Buffer | Uint8Array | string): Uint8Array
From either a string or a Buffer input, create the keccak and return the result as a Uint8Array.
import { keccakAsU8a } from '@polkadot/util-crypto';
keccakAsU8a('123') // => Uint8Array