Class MessageDigestHashFunction

    • Field Detail

      • prototype

        private final java.security.MessageDigest prototype
      • bytes

        private final int bytes
      • supportsClone

        private final boolean supportsClone
      • toString

        private final java.lang.String toString
    • Constructor Detail

      • MessageDigestHashFunction

        MessageDigestHashFunction​(java.lang.String algorithmName,
                                  java.lang.String toString)
      • MessageDigestHashFunction

        MessageDigestHashFunction​(java.lang.String algorithmName,
                                  int bytes,
                                  java.lang.String toString)
    • Method Detail

      • supportsClone

        private static boolean supportsClone​(java.security.MessageDigest digest)
      • bits

        public int bits()
        Description copied from interface: HashFunction
        Returns the number of bits (a multiple of 32) that each hash code produced by this hash function has.
        Specified by:
        bits in interface HashFunction
      • toString

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

        private static java.security.MessageDigest getMessageDigest​(java.lang.String algorithmName)
      • newHasher

        public Hasher newHasher()
        Description copied from interface: HashFunction
        Begins a new hash code computation by returning an initialized, stateful Hasher instance that is ready to receive data. Example:
        
         HashFunction hf = Hashing.md5();
         HashCode hc = hf.newHasher()
             .putLong(id)
             .putBoolean(isActive)
             .hash();
         
        Specified by:
        newHasher in interface HashFunction
      • writeReplace

        java.lang.Object writeReplace()