DigestAlgorithm
Keywords: net.corda.core.crypto.DigestAlgorithm interface
Date: 2023-09-18

net.corda.core.crypto

## Interface DigestAlgorithm

-     public DigestAlgorithm

  Interface for injecting custom digest implementation bypassing JCA.

- - ### Constructor Detail

    - #### DigestAlgorithm

          public DigestAlgorithm()

  - ### Method Detail

    - #### getAlgorithm

          @NotNull
          java.lang.String getAlgorithm()

      Algorithm identifier.

    - #### getDigestLength

          int getDigestLength()

      The length of the digest in bytes.

    - #### digest

          @NotNull
          kotlin.Array[] digest(@NotNull
                                         kotlin.Array[] bytes)

      Computes the digest of the ByteArray.

      Parameters:
        `bytes` - The ByteArray to hash.
      See Also:
        ByteArray

    - #### componentDigest

          @NotNull
          kotlin.Array[] componentDigest(@NotNull
                                                  kotlin.Array[] bytes)

      Computes the digest of the ByteArray which is resistant to pre-image attacks. Only used to calculate the hash of the leaves of the ComponentGroup Merkle tree, starting from its serialized components. Default implementation provides double hashing, but can it be changed to single hashing or something else for better performance.

      See Also:
        ByteArray

    - #### nonceDigest

          @NotNull
          kotlin.Array[] nonceDigest(@NotNull
                                              kotlin.Array[] bytes)

      Computes the digest of the ByteArray which is resistant to pre-image attacks. Only used to calculate the nonces for the leaves of the ComponentGroup Merkle tree. Default implementation provides double hashing, but can it be changed to single hashing or something else for better performance.

      See Also:
        ByteArray