Functions
randomAsU8a
▸ randomAsU8a(length?: number): Uint8Array
Defined in random/asU8a.ts:21
name: randomAsU8a
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([...])
1
2
3
2
3
Parameters:
| Name | Type | Default value |
|---|---|---|
Default value length | number | 32 |
Returns: Uint8Array