Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Sha512

Hierarchy

Index

Properties

Properties

Readonly final

final: (rawState: Uint8Array) => Uint8Array

Finish an incremental sha512 hashing computation.

Returns the final hash.

param

a raw state returned by update.

Type declaration

    • (rawState: Uint8Array): Uint8Array
    • Parameters

      • rawState: Uint8Array

      Returns Uint8Array

Readonly hash

hash: (input: Uint8Array) => Uint8Array

Returns the sha512 hash of the provided input.

To incrementally construct a sha512 hash (e.g. for streaming), use init, update, and final.

param

a Uint8Array to be hashed using sha512

Type declaration

    • (input: Uint8Array): Uint8Array
    • Parameters

      • input: Uint8Array

      Returns Uint8Array

Readonly init

init: () => Uint8Array

Begin an incremental sha512 hashing computation.

The returned raw state can be provided to update with additional input to advance the computation.

Example

const state1 = sha512.init();
const state2 = sha512.update(state1, new Uint8Array([1, 2, 3]));
const state3 = sha512.update(state2, new Uint8Array([4, 5, 6]));
const hash = sha512.final(state3);

Type declaration

    • (): Uint8Array
    • Returns Uint8Array

Readonly update

update: (rawState: Uint8Array, input: Uint8Array) => Uint8Array

Add input to an incremental sha512 hashing computation.

Returns a raw state which can again be passed to update with additional input to continue the computation.

When the computation has been updated with all input, pass the raw state to final to finish and return a hash.

param

a raw state returned by either init or update

param

a Uint8Array to be added to the sha512 computation

Type declaration

    • (rawState: Uint8Array, input: Uint8Array): Uint8Array
    • Parameters

      • rawState: Uint8Array
      • input: Uint8Array

      Returns Uint8Array

Generated using TypeDoc