SHA-2-512 cryptographic hash algorithm.

Hierarchy

  • SHA512

    Implements

    Constructors

    Properties

    _stateHi: Int32Array = ...
    _stateLo: Int32Array = ...
    blockSize: number = BLOCK_SIZE

    Block size

    digestLength: number = DIGEST_LENGTH

    Length of hash output

    Methods

    • Finalizes hash state and puts hash into out. If hash was already finalized, puts the same value.

      Parameters

      • out: Uint8Array

      Returns this

    • Resets hash state making it possible to re-use this instance to hash other data.

      Returns this

    • Function useful for HMAC/PBKDF2 optimization. Restores state saved by saveState() and sets bytesHashed to the given value.

      Parameters

      Returns this

    • Updates hash state with the given data.

      Throws error when trying to update already finalized hash: instance must be reset to update it again.

      Parameters

      • data: Uint8Array
      • dataLength: number = data.length

      Returns this