|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--dtw.webmail.util.MD5
This class implements the MD5 algorithm. *
* The specification is available from RFC 1321, * and there are numerous implementations out there, * this one was tuned specifically for hashing short * strings (i.e. passwords). *
* I do not recommend to use this implementation for * anything else but that, and if anybody feels that * this code is to "close" to something available on * the net, please contact me, and I will certainly take * steps to clear up the situation.
Constructor Summary | |
MD5()
|
Method Summary | |
static java.lang.String |
asHex(byte[] data)
Returns a String containing unsigned hexadecimal * numbers as digits. |
static byte[] |
digest(byte[] msg)
Returns the MD5 hash of the input data. |
static java.lang.String |
hash(java.lang.String str)
Returns the MD5 hash digest transformed into a hex * representation as String. |
static void |
main(java.lang.String[] args)
A main, to allow using this class from the command line. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MD5()
Method Detail |
public static final java.lang.String hash(java.lang.String str)
public static final byte[] digest(byte[] msg)
* Following the the MD5 standard specification, the result * is returned least significant byte first, however, * many applications use the most significant byte first (more conventional). * * @param msg the byte[] to be digested. * * @return the MD5 hash of the data as String.
public static final java.lang.String asHex(byte[] data)
* Contains two hex digit characters for each byte from the passed in * byte[]. * * @param data the array of bytes to be converted into a hex-string. * @return the generated hexadecimal representation as * String.
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |