790 B
790 B
Functions
randomAsU8a
▸ randomAsU8a(length?: number): Uint8Array
Defined in random/asU8a.ts:22
name: randomAsU8a
signature: randomAsU8a (length?: number = 32): Uint8Array
summary: Creates a Uint8Array filled with random bytes.
description: Returns a Uint8Array with the specified (optional) length filled with random bytes.
example:
import { randomAsU8a } from '@polkadot/util-crypto';
randomAsU8a(); // => Uint8Array([...])
Parameters:
| Name | Type | Default value |
|---|---|---|
Default value length |
number |
32 |
Returns: Uint8Array