Crypto Edge
    Preparing search index...

    Function hash

    • Compute a cryptographic hash digest using the Web Crypto API.

      Parameters

      • algorithm: EdgeHashAlgorithm

        One of "SHA-1", "SHA-256", "SHA-384", "SHA-512".

      • data: string | Uint8Array<ArrayBufferLike>

        The data to hash (string or bytes).

      Returns Promise<string>

      Hex-encoded digest string.

      const digest = await hash("SHA-256", "hello world");