Skip to main content

Class: Sha512

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

Table of contents

Properties

Constructors

Methods

Properties

SIZE_224

Static SIZE_224: number = 224

Sha512 224.


SIZE_256

Static SIZE_256: number = 256

Sha512 256.


SIZE_384

Static SIZE_384: number = 384

Sha512 384.


SIZE_512

Static SIZE_512: number = 512

Sha512 512.

Constructors

constructor

new Sha512(bits?)

Create a new instance of Sha512.

Parameters

NameTypeDefault valueDescription
bitsnumberSha512.SIZE_512The number of bits.

Methods

sum512

Static sum512(data): Uint8Array

Perform Sum 512 on the data.

Parameters

NameTypeDescription
dataUint8ArrayThe data to operate on.

Returns

Uint8Array

The sum 512 of the data.


update

update(message): Sha512

Update the hash with the data.

Parameters

NameTypeDescription
messageUint8ArrayThe data to update the hash with.

Returns

Sha512

The instance for chaining.


digest

digest(): Uint8Array

Get the digest.

Returns

Uint8Array

The digest.