Digest
Digests are secure one-way hash functions that take arbitrary-sized data and output a fixed-length hash value.
A Digest object starts out initialized. The data is processed through it using the update methods. At any point reset can be called to reset the digest. Once all the data to be updated has been updated, one of the digest methods should be called to complete the hash computation.
The digest method can be called once for a given number of updates. After digest has been called, the Digest object is reset to its initialized state.
val digest = ...
digest.update(toChapter1)
val tc1 = digest.copy()
val toChapter1Digest = tc1.digest()
digest.update(toChapter2)
... etc.Properties
Return the "block length" for the hash function. This value is naturally defined for iterated hash functions (Merkle-Damgard). It is used in HMAC (that's what the HMAC specification names the "B" parameter).
Get the natural hash function output length (in bytes).
Functions
Completes the hash computation by performing final operations such as padding. The digest is reset after this call is made.
Updates the digest using the specified byte.
Updates the digest using the specified array of bytes.
Updates the digest using the specified array of bytes, starting at the specified offset.