Preparing search index...

    Lower-level cryptographic primitives mirroring the Web Crypto SubtleCrypto interface.

        const { subtle } = await import('LensStudio:Crypto');

    const data = new TextEncoder().encode('Hello, Lens Studio!');
    const hash = await subtle.digest('SHA-256', data);
    const hex = Array.from(hash, (b: number) => b.toString(16).padStart(2, '0')).join('');
    console.log(`SHA-256 (${hash.length} bytes): ${hex.slice(0, 16)}...`);
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Computes a cryptographic hash of the given data using the specified algorithm and returns the resulting digest.

      Parameters

      • algorithm: string
      • data: Uint8Array

      Returns Promise<Uint8Array>