Skip to main content

LensStudio:Crypto

Module

Cryptography module providing secure random value generation, UUIDs, and digest operations modeled after the Web Crypto API.

Example

const Crypto = await import('LensStudio:Crypto');

const buffer = new Uint8Array(16);
Crypto.getRandomValues(buffer);
const id = Crypto.randomUUID();
console.log(`UUID=${id} randomByte0=${buffer[0]}`);

Classes

ClassDescription
subtleLower-level cryptographic primitives mirroring the Web Crypto SubtleCrypto interface.

Functions

FunctionDescription
getRandomValuesFills the given typed array with cryptographically strong random values and returns it.
randomUUIDGenerates a cryptographically random version 4 UUID string.