Skip to main content

Class: HmacSha512

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

Table of contents

Constructors

Methods

Constructors

constructor

new HmacSha512(key, bits?)

Create a new instance of HmacSha512.

Parameters

NameTypeDefault valueDescription
keyUint8ArrayundefinedThe key for the hmac.
bitsnumber512The number of bits.

Methods

sum512

Static sum512(key, data): Uint8Array

Perform Sum 512 on the data.

Parameters

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

Returns

Uint8Array

The sum 512 of the data.


update

update(message): HmacSha512

Update the hash with the data.

Parameters

NameTypeDescription
messageUint8ArrayThe data to update the hash with.

Returns

HmacSha512

The instance for chaining.


digest

digest(): Uint8Array

Get the digest.

Returns

Uint8Array

The digest.