UNPKG

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