public static String getChecksum(final File file, final Algorithm algorithm)
		throws NoSuchAlgorithmException, IOException
	{
		return getChecksum(file, algorithm.getAlgorithm());
	}
public static String getChecksum ( final File file , final Algorithm algorithm ) throws NoSuchAlgorithmException , IOException { return getChecksum ( file , algorithm . getAlgorithm ( ) ) ; }
Gets the checksum from the given file with an instance of the given algorithm.

@param file
the file.
@param algorithm
the algorithm to get the checksum. This could be for instance "MD4", "MD5",
"SHA-1", "SHA-256", "SHA-384" or "SHA-512".
@return The checksum from the file as a String object.
@throws NoSuchAlgorithmException
Is thrown if the algorithm is not supported or does not exists.
{@link java.security.MessageDigest} object.
@throws IOException
Signals that an I/O exception has occurred.