UNPKG

886 BTypeScriptView Raw
1import type { HexString } from '@polkadot/util/types';
2/**
3 * @name xxhashAsU8a
4 * @summary Creates a xxhash64 u8a from the input.
5 * @description
6 * From either a `string`, `Uint8Array` or a `Buffer` input, create the xxhash64 and return the result as a `Uint8Array` with the specified `bitLength`.
7 * @example
8 * <BR>
9 *
10 * ```javascript
11 * import { xxhashAsU8a } from '@polkadot/util-crypto';
12 *
13 * xxhashAsU8a('abc'); // => 0x44bc2cf5ad770999
14 * ```
15 */
16export declare function xxhashAsU8a(data: HexString | Uint8Array | string, bitLength?: 64 | 128 | 192 | 256 | 320 | 384 | 448 | 512, onlyJs?: boolean): Uint8Array;
17/**
18 * @name xxhashAsHex
19 * @description Creates a xxhash64 hex from the input.
20 */
21export declare const xxhashAsHex: (data: string | Uint8Array, bitLength?: 256 | 512 | 64 | 128 | 384 | 320 | 192 | 448 | undefined, onlyJs?: boolean | undefined) => `0x${string}`;