ts-lambda-api - v2.5.2
    Preparing search index...

    Interface Hash

    An object that provides a hash of data provided in chunks to update. The hash may be performed incrementally as chunks are received or all at once when the hash is finalized, depending on the underlying implementation.

    use Checksum

    interface Hash {
        digest(): Promise<Uint8Array<ArrayBufferLike>>;
        update(toHash: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void;
    }
    Index

    Methods

    Methods

    • Finalizes the hash and provides a promise that will be fulfilled with the raw bytes of the calculated hash.

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Adds a chunk of data to the hash. If a buffer is provided, the encoding argument will be ignored. If a string is provided without a specified encoding, implementations must assume UTF-8 encoding.

      Not all encodings are supported on all platforms, though all must support UTF-8.

      Parameters

      • toHash: SourceData
      • Optionalencoding: "utf8" | "ascii" | "latin1"

      Returns void