UNPKG

581 BTypeScriptView Raw
1/**
2 * @name randomAsU8a
3 * @summary Creates a Uint8Array filled with random bytes.
4 * @description
5 * Returns a `Uint8Array` with the specified (optional) length filled with random bytes.
6 * @example
7 * <BR>
8 *
9 * ```javascript
10 * import { randomAsU8a } from '@polkadot/util-crypto';
11 *
12 * randomAsU8a(); // => Uint8Array([...])
13 * ```
14 */
15export declare function randomAsU8a(length?: number): Uint8Array;
16/**
17 * @name randomAsHex
18 * @description Creates a hex string filled with random bytes.
19 */
20export declare const randomAsHex: (length?: number | undefined) => `0x${string}`;