Skip to main content

crypto.getRandomValues

Function

Fills a provided Uint8Array with cryptographically secure random values.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

getRandomValues(typedArray): Uint8Array

Fills a provided Uint8Array with cryptographically secure random values. This method emulates crypto.getRandomValues() from the Web Crypto API.

typedArray A Uint8Array to fill with random values.

Returns: Uint8Array The same array passed in after being filled with random values.

Parameters

ParameterType
typedArrayUint8Array

Returns

Uint8Array