The DigestTransform interface defines the interface of message
digest algorithms, such as MD5 and SHA. Message digests are
secure hash functions that take a message of arbitrary length
and produce a fix length digest as output.
A object implementing the DigestTransform should start out initialized.
The data is processed though calls to the update method. Once all data
has been sent to the algorithm, the digest is finalized and computed
with the digest method.
The digest method may only be called once. After the digest
method has been called, the algorithm is reset to its initial
state.
Using the update method, data may be processed piece by piece,
which is useful for cases involving streams of data.
For example:
// create an MD5 hash algorithmMd5hash = newMd5();
// process some datahash.update("The quick brown fox");
// process some more datahash.update(" jumps over the lazy dog");
// conclude algorithm and produce digestubyte[] digest = hash.binaryDigest();
The DigestTransform interface defines the interface of message digest algorithms, such as MD5 and SHA. Message digests are secure hash functions that take a message of arbitrary length and produce a fix length digest as output.
A object implementing the DigestTransform should start out initialized. The data is processed though calls to the update method. Once all data has been sent to the algorithm, the digest is finalized and computed with the digest method.
The digest method may only be called once. After the digest method has been called, the algorithm is reset to its initial state.
Using the update method, data may be processed piece by piece, which is useful for cases involving streams of data.
For example: