public class MD5 extends Object
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
aDigest |
protected long |
bits |
protected int[] |
buf |
protected static int |
DIGEST_SIZE |
protected boolean |
finalized |
protected byte[] |
in |
protected int[] |
inint |
protected static String |
stVersion |
| Constructor and Description |
|---|
MD5()
Creates a new MD5 object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
digest()
Completes the digest operation.
|
boolean |
equals(byte[] otherDigest)
Compares the message digest with another message digest.
|
byte[] |
getDigest()
Retrieves the digest.
|
static String |
getVersion()
Returns the version of the class.
|
void |
reset()
Initializes (or resets) the hasher for a new session.
|
String |
toString()
makes a (lower case) binhex string representation of the current digest.
|
void |
update(byte newbyte)
Adds a single byte to the digest.
|
void |
update(byte[] newbuf)
Adds a complete byte array to the digest.
|
void |
update(byte[] newbuf,
int length)
Adds a portion of a byte array to the digest.
|
void |
update(byte[] newbuf,
int bufstart,
int buflen)
Adds a portion of a byte array to the digest.
|
void |
update(File f)
Adds a complete file to the digest.
|
void |
update(String newstring)
Adds a String to the digest.
|
protected static String stVersion
protected int[] buf
protected long bits
protected byte[] in
protected int[] inint
protected boolean finalized
protected static final int DIGEST_SIZE
protected byte[] aDigest
public static String getVersion()
public void digest()
public boolean equals(byte[] otherDigest)
otherDigest - another MD5 digestpublic byte[] getDigest()
public void reset()
public String toString()
public void update(byte newbyte)
newbyte - the byte to addpublic void update(byte[] newbuf)
newbuf - the byte array to addpublic void update(String newstring)
newstring - the String to addpublic void update(byte[] newbuf,
int length)
newbuf - the data to addlength - the number of bytes to add from the beginning of the arraypublic void update(byte[] newbuf,
int bufstart,
int buflen)
newbuf - the data to addbufstart - the offset of the bytes in the data array.buflen - the number of bytes to addpublic void update(File f) throws IOException
f - the File object representing the physical fileIOException