@SuppressWarnings("DoNotInvokeMessageDigestDirectly")
  public static MessageDigest create(final String algorithm) throws NoSuchAlgorithmException {
    return switch (algorithm) {
      case KECCAK256_ALG -> new Keccak.Digest256();
      case SHA256_ALG -> new SHA256.Digest();
      case RIPEMD160_ALG -> new RIPEMD160.Digest();
      case BLAKE2BF_ALG -> new Blake2bfMessageDigest();
      default -> MessageDigest.getInstance(algorithm);
    };
  }
Create message digest.

@param algorithm the algorithm
@return the message digest
@throws NoSuchAlgorithmException the no such algorithm exception
crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/MessageDigestFactory.java