Returns a digest object of the specified type.
if (algorithm == null) {
return null;
}
if (algorithm.equals("SHA-1")) {
return new Sha1MessageDigest();
}
else if (algorithm.equals("MD5")) {
return new Md5MessageDigest();
}
throw new NoSuchAlgorithmException();