pdf-lite - v1.0.1
    Preparing search index...

    Function hash

    • Computes a cryptographic hash of the input data using the specified algorithm.

      Parameters

      • input: ByteArray

        The data to hash.

      • algorithm: "SHA-1" | "SHA-256" | "SHA-384" | "SHA-512" | "MD5" = 'SHA-256'

        The hash algorithm to use. Defaults to 'SHA-256'.

      Returns Promise<ByteArray>

      A promise that resolves to the hash as a byte array.

      Error if an unsupported hash algorithm is specified.

      const hash = await hash(data, 'SHA-256')