Skip to Content
Skip to Content
ClassesCryptoHash

CryptoHash


Methods

digest

Returns the finalized hash value.

If the hash object was created with a key, this would close the object.

:digest(): buffer :digest(encoding: "binary"): buffer :digest(encoding: "hex" | "base64"): string :digest(encoding: string): string | buffer

Parameters

  • encoding: "binary" | "hex" | "base64" | string? - The encoding of the output.
    • default: "binary"

Throws

  • Memory Error

update

:update(value: string | buffer): ()

Parameters

  • value: string | buffer - The value to update the hash with.

Throws

  • Crypto Error

copy

Copies the current hash state.

If the hash object was created with a key, the object must still be opened.

:copy(): CryptoHash

Throws

  • Crypto Error
  • Memory Error
Last updated on