code: public static String getAlgorithm(final URI digestUri) {
          if (digestUri == null) {
              return DEFAULT_ALGORITHM;
          }
          return DIGEST_ALGORITHM.fromScheme(digestUri.getScheme() + ":" +
               digestUri.getSchemeSpecificPart().split(":", 2)[0]).algorithm;
      }
docs: Given a digest URI, get the corresponding MessageDigest algorithm
  @param digestUri the digest uri
  @return MessageDigest algorithm