getHashFunction function
Returns a HashFunction implementation for the given choice
.
Throws UnsupportedAlgorithmException if the hash algorithm is not supported.
Implementation
HashFunction getHashFunction(final HashFunctionChoice choice) {
final hashFunction = _hashChoiceToAlgorithm[choice];
if (hashFunction == null) {
throw UnsupportedAlgorithmException('Hash algorithm $choice is not supported.');
}
return hashFunction;
}