Skip to main content
webcrypto.Crypto.getRandomValues - node__crypto.d.ts - Node documentation
method webcrypto.Crypto.getRandomValues

Usage in Deno

```typescript import { type webcrypto } from "node:node__crypto.d.ts"; ```
Crypto.getRandomValues<T extends Exclude<TypedArray, Float32Array | Float64Array>>(typedArray: T): T
Generates cryptographically strong random values. The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. The given `typedArray` must be an integer-based instance of NodeJS.TypedArray, i.e. `Float32Array` and `Float64Array` are not accepted. An error will be thrown if the given `typedArray` is larger than 65,536 bytes.

Type Parameters

T extends Exclude<TypedArray, Float32Array | Float64Array>

Parameters

typedArray: T

Return Type

T