Skip to main content
Module

x/hmac/mod.ts>HMAC

hash-based message authentication code
Latest
class HMAC
import { HMAC } from "https://deno.land/x/hmac@v2.0.1/mod.ts";

A class representation of the HMAC algorithm.

Constructors

new
HMAC(hasher: Hash, key?: string | Uint8Array)

Creates a new HMAC instance.

Properties

private
hasher: Hash
private
iKeyPad: Uint8Array
private
oKeyPad: Uint8Array
readonly
B: number
readonly
hashSize: number
readonly
iPad: number
readonly
oPad: number

Methods

digest(outputEncoding?: string): string | Uint8Array

Finalize the HMAC with additional message data.

init(key: string | Uint8Array, inputEncoding?: string): HMAC

Initializes an HMAC instance.

update(msg?: string | Uint8Array, inputEncoding?: string): HMAC

Update the HMAC with additional message data.