Node:The IMessageDigest Interface, Next:, Previous:Message Digests, Up:Message Digests

IMessageDigest Interface

Figure 8: Message Digest class diagram

void update (byte b) Function
Updates the hash being computed with a single byte.

void update (byte[] buf, int offset, int length) Function
Update the hash being computed with length of the bytes in buf starting at offset. The programmer should ensure that buf is at least offset + length bytes long.

byte [] digest ( ) Function
Finishes the computation of the hash and returns the result as a byte array. The input read thusfar may be padded first (depending on the algorithm), and the instance is reset.

java.lang.String name ( ) Function
Returns the canonical name of this message digest.

int hashSize ( ) Function
Returns the size of the final hash (the byte array returned by digest()) in bytes.

int blockSize ( ) Function
Returns the algorithm's internal block size, in bytes.

void reset ( ) Function
Resets the internal state of the hash, making its state equivalent to that of a newly-created instance.

boolean selfTest ( ) Function
Performs a simple conformance test of the underlying implementation, to guard against implementation or environment errors. Returns true if the test succeeds, false if it fails.

java.lang.Object clone ( ) Function
Copies the state of this instance into a new instance, returning the copy. This copy can then be used in the same way as the original instance.