Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.commons.hash;

Interface that governs implementations

Author(s):
Manik Surtani
Patrick McFarland
See also:
MurmurHash2
MurmurHash3
public interface Hash {
   
Hashes a byte array efficiently.

Parameters:
payload a byte array to hash
Returns:
a hash code for the byte array
   int hash(byte[] payload);

   
An incremental version of the hash function, that spreads a pre-calculated hash code, such as one derived from java.lang.Object.hashCode().

Parameters:
hashcode an object's hashcode
Returns:
a spread and hashed version of the hashcode
   int hash(int hashcode);

   
A helper that calculates the hashcode of an object, choosing the optimal mechanism of hash calculation after considering the type of the object (byte array, String or Object).

Parameters:
o object to hash
Returns:
a hashcode
   int hash(Object o);
New to GrepCode? Check out our FAQ X