Cryptography module providing secure random value generation, UUIDs, and digest operations modeled after the Web Crypto API.
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]}`); Copy
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]}`);
Cryptography module providing secure random value generation, UUIDs, and digest operations modeled after the Web Crypto API.
Example