Skip to main content
Go to Latest
method crypto.DigestContext.prototype.digestAndReset
import { crypto } from "https://deno.land/std@0.116.0/_wasm_crypto/mod.ts";
const { DigestContext } = crypto;

Returns the digest of the input data so far, and resets this context to its initial state, as though it has not yet been provided with any input data. (It will still use the same algorithm.)

length will usually be left undefined to use the default length for the algorithm. For algorithms with variable-length output, it can be used to specify a non-negative integer number of bytes.

An error will be thrown if algorithm is not a supported hash algorithm or length is not a supported length for the algorithm.