UNPKG

995 BTypeScriptView Raw
1/**
2 * Cryptographic hashing functions
3 *
4 * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]
5 */
6import type { BytesLike } from "../utils/index.js";
7/**
8 * Compute the cryptographic KECCAK256 hash of %%data%%.
9 *
10 * The %%data%% **must** be a data representation, to compute the
11 * hash of UTF-8 data use the [[id]] function.
12 *
13 * @returns DataHexstring
14 * @example:
15 * keccak256("0x")
16 * //_result:
17 *
18 * keccak256("0x1337")
19 * //_result:
20 *
21 * keccak256(new Uint8Array([ 0x13, 0x37 ]))
22 * //_result:
23 *
24 * // Strings are assumed to be DataHexString, otherwise it will
25 * // throw. To hash UTF-8 data, see the note above.
26 * keccak256("Hello World")
27 * //_error:
28 */
29export declare function keccak256(_data: BytesLike): string;
30export declare namespace keccak256 {
31 var _: (data: Uint8Array) => Uint8Array;
32 var lock: () => void;
33 var register: (func: (data: Uint8Array) => BytesLike) => void;
34}
35//# sourceMappingURL=keccak.d.ts.map
\No newline at end of file