Class SHA1

This is not the default because it's not cryptographically secure and it's slower than SHA512

Consider using the ugly-named SHA512_256 instead

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

byteLength: 20

The number of bytes the hash will produce

Methods

  • Finalize the hash

    Parameters

    • encoding: DigestEncoding

      DigestEncoding to return the hash in. If none is provided, it will return a Uint8Array.

    Returns string

  • Finalize the hash

    Parameters

    • Optional hashInto: TypedArray

      TypedArray to write the hash into. Faster than creating a new one each time

    Returns TypedArray

  • Run the hash over the given data

    Parameters

    • input: StringOrBuffer

      string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer is faster.

    • Optional hashInto: TypedArray

      TypedArray to write the hash into. Faster than creating a new one each time

    Returns TypedArray

  • Run the hash over the given data

    Parameters

    • input: StringOrBuffer

      string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer is faster.

    • encoding: DigestEncoding

      DigestEncoding to return the hash in

    Returns string

Generated using TypeDoc