|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.wimpi.pim.util.MD5
A class implements the MD5 algorithm.
The MD5 algorithm is described in RFC 1321. There are numerous implementations out there, this one was tuned specifically for hashing short strings (i.e. passwords).
It is not recommend to use this implementation for anything else but that.
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 long |
hashValue(byte[] msg,
boolean high)
|
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)
String
.
String
.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).
msg
- the byte[]
to be digested.
String
.public static final java.lang.String asHex(byte[] data)
String
containing unsigned hexadecimal
numbers as digits.
Contains two hex digit characters for each byte from the passed in
byte[]
.
data
- the array of bytes to be converted into a hex-string.
String
.public static final long hashValue(byte[] msg, boolean high)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |