Skip to main content
Go to Latest
method DigestContext.prototype.digestAndDrop
import { DigestContext } from "https://deno.land/std@0.145.0/_wasm_crypto/mod.ts";

Returns the digest of the input data so far, and then drops the context from memory on the Wasm side. This context must no longer be used, and any further method calls will result in null pointer errors being thrown. https://github.com/rustwasm/wasm-bindgen/blob/bf39cfd8/crates/backend/src/codegen.rs#L186

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.