public static String toDigestAlgo(HashType hash) throws GeneralSecurityException {
    switch (hash) {
      case SHA1:
        return "SHA-1";
      case SHA224:
        return "SHA-224";
      case SHA256:
        return "SHA-256";
      case SHA384:
        return "SHA-384";
      case SHA512:
        return "SHA-512";
    }
    throw new GeneralSecurityException("Unsupported hash " + hash);
  }
Returns the digest algorithm name corresponding to a hash type.

@param hash the hash type.
@return theh JCE's hash algorithm name.
@throws GeneralSecurityException if {@code hash} is not supported.
java_src/src/main/java/com/google/crypto/tink/subtle/SubtleUtil.java