Package nl.tue.storage.hashing.impl
Class AdHashHashCodeProvider
- java.lang.Object
-
- nl.tue.storage.hashing.impl.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
-
-
Constructor Summary
Constructors Constructor Description AdHashHashCodeProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected inth(int idx, int s)protected inth(int idx, short s)inthash(int[]... sets)inthash(short[]... sets)inthash(ShortShortMultiset... sets)java.lang.StringtoString()intupdateHash(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.intupdateHash(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.
-
-
-
Field Detail
-
INIT
public static final int INIT
- See Also:
- Constant Field Values
-
C1
public static final int C1
- See Also:
- Constant Field Values
-
C2
public static final int C2
- See Also:
- Constant Field Values
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hash
public int hash(ShortShortMultiset... sets)
- Specified by:
hashin interfaceHashCodeProvider
-
hash
public int hash(short[]... sets)
- Specified by:
hashin interfaceHashCodeProvider
-
h
protected int h(int idx, short s)
-
h
protected int h(int idx, int s)
-
hash
public int hash(int[]... sets)
- Specified by:
hashin interfaceHashCodeProvider
-
updateHash
public int updateHash(int oldHash, int idx, short oldVal, short newVal)Description copied from interface:IncrementalHashCodeProviderUpdates 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:
updateHashin interfaceIncrementalHashCodeProvider- Returns:
-
updateHash
public int updateHash(int oldHash, int idx, int oldVal, int newVal)Description copied from interface:IncrementalHashCodeProviderUpdates 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:
updateHashin interfaceIncrementalHashCodeProvider- Returns:
-
-