SecureHash.componentHashAs - corda

corda / net.corda.core.crypto / SecureHash / componentHashAs

# componentHashAs

`@JvmStatic fun componentHashAs(algorithm: String, bytes: ByteArray): SecureHash`

Computes the digest of the ByteArray which is resistant to pre-image attacks. It computes the hash of the hash for SHA2-256 and other algorithms loaded via JCA MessageDigest. For custom algorithms the strategy can be modified via DigestAlgorithm.

### Parameters

`algorithm` - The MessageDigest algorithm to use.

`bytes` - The ByteArray to hash.