crypto / org.apache.tuweni.crypto / Hash / digestUsingAlgorithm

digestUsingAlgorithm

static fun digestUsingAlgorithm(input: ByteArray, alg: String): ByteArray (source)
static fun digestUsingAlgorithm(input: Bytes, alg: String): Bytes (source)

Helper method to generate a digest using the provided algorithm.

Parameters

input - The input bytes to produce the digest for.

alg - The name of the digest algorithm to use.

Exceptions

NoSuchAlgorithmException - If no Provider supports a MessageDigestSpi implementation for the specified algorithm.

Return
A digest.