doFinal

Generates a hash of all/last input data.
Completes and returns the hash computation after performing final operations such as padding.
The MessageDigest object is reset to the initial state after this call is made.

update

Accumulates a hash of the input data. This method requires temporary storage of
intermediate results. In addition, if the input data length is not block aligned
(multiple of block size)
then additional internal storage may be allocated at this time to store a partial
input data block.
This may result in additional resource consumption and/or slow performance.
This method should only be used if all the input data required for the hash
is not available in one byte array. If all of the input data required for
the hash is located in a single byte array, use of the doFinal()
method is recommended. The doFinal()
method must be called to complete processing of input data accumulated by one or more
calls to the update() method.