mazey
    Preparing search index...

    Function sha256Hex

    • Generate a lowercase SHA-256 hexadecimal digest with the Web Crypto API.

      Usage:

      import { sha256Hex } from "mazey";

      const digest = await sha256Hex("hello world");
      console.log(digest);

      Output:

      b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
      

      Parameters

      • input: string | BufferSource

        Text or binary data to hash.

      Returns Promise<string>

      A promise that resolves to the lowercase hexadecimal digest.

      Requires Web Crypto. String input also requires TextEncoder.

      When the required platform API is unavailable. Digest failures are propagated.