Package com.yahoo.collections
Class MD5
- java.lang.Object
-
- com.yahoo.collections.MD5
-
public class MD5 extends java.lang.Object
Convenience class for hashing a String with MD5, and either returning an int with the 4 LSBytes, or the whole 12-byte MD5 hash.Note that instantiating this class can be expensive, so re-using instances is a good idea.
This class is not thread safe.
- Author:
- Einar M R Rosenvinge
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.ThreadLocal<java.security.MessageDigest>
md5
-
Constructor Summary
Constructors Constructor Description MD5()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
hash(java.lang.String s)
byte[]
hashFull(java.lang.String s)
-