Skip to main content

Class: HmacSha1

Class to help with HmacSha1 scheme. TypeScript conversion from https://github.com/emn178/js-sha1.

Table of contents

Constructors

Methods

Constructors

constructor

new HmacSha1(key)

Create a new instance of HmacSha1.

Parameters

NameTypeDescription
keyUint8ArrayThe key for the hmac.

Methods

sum

Static sum(key, data): Uint8Array

Perform Sum on the data.

Parameters

NameTypeDescription
keyUint8ArrayThe key for the hmac.
dataUint8ArrayThe data to operate on.

Returns

Uint8Array

The sum of the data.


update

update(message): HmacSha1

Update the hash with the data.

Parameters

NameTypeDescription
messageUint8ArrayThe data to update the hash with.

Returns

HmacSha1

The instance for chaining.


digest

digest(): Uint8Array

Get the digest.

Returns

Uint8Array

The digest.