Class AbstractCompositeHashFunction

    • Constructor Detail

      • AbstractCompositeHashFunction

        AbstractCompositeHashFunction​(HashFunction... functions)
    • Method Detail

      • makeHash

        abstract HashCode makeHash​(Hasher[] hashers)
        Constructs a HashCode from the Hasher objects of the functions. Each of them has consumed the entire input and they are ready to output a HashCode. The order of the hashers are the same order as the functions given to the constructor.
      • 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();