Class MD5Digest


  • public class MD5Digest
    extends java.lang.Object
    The result of the computation of an MD5 digest. A MD5 is really just a byte[] but arrays are a no go as map keys. We could wrap it in a ByteBuffer but: 1. MD5Digest is a more explicit name than ByteBuffer to represent a md5. 2. Using our own class allows to use our FastByteComparison for equals.
    • Field Detail

      • bytes

        public final byte[] bytes
    • Method Detail

      • wrap

        public static MD5Digest wrap​(byte[] digest)
      • compute

        public static MD5Digest compute​(byte[] toHash)
      • compute

        public static MD5Digest compute​(java.lang.String toHash)
      • byteBuffer

        public java.nio.ByteBuffer byteBuffer()
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • threadLocalMD5Digest

        public static java.security.MessageDigest threadLocalMD5Digest()