Skip to main content
Module

x/blake2b/mod.ts>Blake2b

BLAKE2b implemented in WebAssembly
Latest
class Blake2b
import { Blake2b } from "https://deno.land/x/blake2b@v0.1.0/mod.ts";

Constructors

new
Blake2b(
bytes: number,
key?: string | Uint8Array,
salt?: string | Uint8Array,
personal?: string | Uint8Array,
inputEncoding?: string,
)

Creates a new Blake2b instance computing the BLAKE2b checksum with a custom length. Providing a key turns the hash into a MAC. The key must be between zero and 64 bytes long. The digest size can be a value between 1 and 64 but it is highly recommended to use values equal or greater than:

  • 32 if BLAKE2b is used as a hash function (key is zero bytes long).
  • 16 if BLAKE2b is used as a MAC function (key is at least 16 bytes long).

Properties

private
finalized: boolean
private
pointer: number
readonly
bytes: number

Methods

digest(outputEncoding?: string): string | Uint8Array

Obtains a digest of all fed-in data.

update(input: string | Uint8Array, inputEncoding?: string): Blake2b

Updates the hash with additional data.

Static Properties

protected
freeList: number[]
protected
head: number
protected
wasm: Wasm
readonly
WASM: Uint8Array