getMessageDigest(String) method

Instantiates a MessageDigest object with the specified algorithm.

Syntax

synchronized MessageDigest getMessageDigest ( String algorithm ) throws NoSuchAlgorithmException

Parameters

Returns

MessageDigest instance that uses the specified algorithm.

Exceptions

Usage

If a previous instance of MessageDigest using the same algorithm is found in the cache, it is cloned and returned. If not, a new instance is created and saved in a hash table for later usage. To be thread safe, always a clone of the created digest is returned.

MessageDigest instance that uses the specified algorithm.