Class AdHashHashCodeProvider

  • All Implemented Interfaces:
    HashCodeProvider, IncrementalHashCodeProvider

    public class AdHashHashCodeProvider
    extends java.lang.Object
    implements IncrementalHashCodeProvider
    The AdHashHashCodeProvider is an incremental hash function, loosely based on the MurMur3 hash function. The idea comes from "M. Bellare, and D. Micciancio, "A new paradigm for collision-free hashing: Incrementality at reduced cost, Advances in Cryptology - EUROCRYPT'97, Lecture Notes in Computer Science, 1233, pp.163- 192, Springer-Verlag, 1997."
    Author:
    bfvdonge
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int C1  
      static int C2  
      static int INIT  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int h​(int idx, int s)  
      protected int h​(int idx, short s)  
      int hash​(int[]... sets)  
      int hash​(short[]... sets)  
      int hash​(ShortShortMultiset... sets)  
      java.lang.String toString()  
      int updateHash​(int oldHash, int idx, int oldVal, int newVal)
      Updates the old hash value and returns the new one, assuming that the value at index idx was changed from oldVal to newVal.
      int updateHash​(int oldHash, int idx, short oldVal, short newVal)
      Updates the old hash value and returns the new one, assuming that the value at index idx was changed from oldVal to newVal.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AdHashHashCodeProvider

        public AdHashHashCodeProvider()
    • Method Detail

      • toString

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

        protected int h​(int idx,
                        short s)
      • h

        protected int h​(int idx,
                        int s)
      • updateHash

        public int updateHash​(int oldHash,
                              int idx,
                              short oldVal,
                              short newVal)
        Description copied from interface: IncrementalHashCodeProvider
        Updates the old hash value and returns the new one, assuming that the value at index idx was changed from oldVal to newVal. Note that idx should be an index into the concatenation of the arrays previously provided in the call to hash().
        Specified by:
        updateHash in interface IncrementalHashCodeProvider
        Returns:
      • updateHash

        public int updateHash​(int oldHash,
                              int idx,
                              int oldVal,
                              int newVal)
        Description copied from interface: IncrementalHashCodeProvider
        Updates the old hash value and returns the new one, assuming that the value at index idx was changed from oldVal to newVal. Note that idx should be an index into the concatenation of the arrays previously provided in the call to hash().
        Specified by:
        updateHash in interface IncrementalHashCodeProvider
        Returns: