UNPKG

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