Function sha

  • Hash input using SHA-2 512/256

    Parameters

    • input: StringOrBuffer

      string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer will be faster

    • Optional hashInto: Uint8Array

      optional Uint8Array to write the hash to. 32 bytes minimum.

      This hashing function balances speed with cryptographic strength. This does not encrypt or decrypt data.

      The implementation uses BoringSSL (used in Chromium & Go)

      The equivalent openssl command is:

      # You will need OpenSSL 3 or later
      openssl sha512-256 /path/to/file

    Returns Uint8Array

  • Hash input using SHA-2 512/256

    Parameters

    • input: StringOrBuffer

      string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer will be faster

    • encoding: DigestEncoding

      DigestEncoding to return the hash in

      This hashing function balances speed with cryptographic strength. This does not encrypt or decrypt data.

      The implementation uses BoringSSL (used in Chromium & Go)

      The equivalent openssl command is:

      # You will need OpenSSL 3 or later
      openssl sha512-256 /path/to/file

    Returns string

  • Hash input using SHA-2 512/256

    Parameters

    • input: StringOrBuffer

      string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer will be faster

    • Optional hashInto: Uint8Array

      optional Uint8Array to write the hash to. 32 bytes minimum.

      This hashing function balances speed with cryptographic strength. This does not encrypt or decrypt data.

      The implementation uses BoringSSL (used in Chromium & Go)

      The equivalent openssl command is:

      # You will need OpenSSL 3 or later
      openssl sha512-256 /path/to/file

    Returns Uint8Array

  • Hash input using SHA-2 512/256

    Parameters

    • input: StringOrBuffer

      string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer will be faster

    • encoding: DigestEncoding

      DigestEncoding to return the hash in

      This hashing function balances speed with cryptographic strength. This does not encrypt or decrypt data.

      The implementation uses BoringSSL (used in Chromium & Go)

      The equivalent openssl command is:

      # You will need OpenSSL 3 or later
      openssl sha512-256 /path/to/file

    Returns string

Generated using TypeDoc