public class MD5 extends MessageDigest
Implements the RSA Data Security, Inc. MD5 Message-Digest Algorithm. This is almoust straight implementation of the reference implementation given in RFC1321 by RSA.
Note: It seems to be faster then the JDK1.4 MD5 implementation (java.security.MessageDigest.getInstance("MD5")).
Constructor and Description |
---|
MD5()
Constructor
|
MD5(byte[] buffer)
Constructor
|
MD5(byte[] buffer,
int offset,
int len)
Constructor
|
MD5(java.lang.String str)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
digest(byte[] buffer)
Calculates the MD5.
|
static byte[] |
digest(byte[] buffer,
int offset,
int len)
Calculates the MD5.
|
static byte[] |
digest(java.lang.String str)
Calculates the MD5.
|
byte[] |
doFinal()
MessageDigest finalization.
|
MessageDigest |
update(byte[] buffer,
int offset,
int len)
MessageDigest block update operation.
|
asHex, getDigest, update, update
public MD5()
public MD5(byte[] buffer)
public MD5(byte[] buffer, int offset, int len)
public MD5(java.lang.String str)
public MessageDigest update(byte[] buffer, int offset, int len)
update
in class MessageDigest
public byte[] doFinal()
doFinal
in class MessageDigest
public static byte[] digest(byte[] buffer, int offset, int len)
public static byte[] digest(byte[] buffer)
public static byte[] digest(java.lang.String str)