public static HashType getHashType(String md) throws NoSuchAlgorithmException {
    switch (md) {
      case "SHA-256":
        return HashType.SHA256;
      case "SHA-512":
        return HashType.SHA512;
      case "SHA-1":
        return HashType.SHA1;
      default:
        throw new NoSuchAlgorithmException("Unsupported hash name: " + md);
    }
  }
Gets hash type from hash name.

@param md the name of the message digest (e.g. "SHA-256").
@return the hash type.
@throws NoSuchAlgorithmException iff the hash name is unknown.
java_src/src/main/java/com/google/crypto/tink/testing/WycheproofTestUtil.java