Package org.infinispan.commons.hash
Class CRC16
java.lang.Object
org.infinispan.commons.hash.CRC16
- All Implemented Interfaces:
Hash
A CRC16 implementation in Java.
- Since:
- 15.0
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CRC16
int
hash
(byte[] payload) Hashes a byte array efficiently.int
hash
(int hashcode) An incremental version of the hash function, that spreads a pre-calculated hash code, such as one derived fromObject.hashCode()
.int
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).int
How many bits this hash function may utilize.toString()
-
Method Details
-
getInstance
-
hash
public int hash(byte[] payload) Description copied from interface:Hash
Hashes a byte array efficiently. -
maxHashBits
public int maxHashBits()Description copied from interface:Hash
How many bits this hash function may utilize. By default a hash algorithm is assumed to use all 32 bits producing a value in the full range of int values.- Specified by:
maxHashBits
in interfaceHash
- Returns:
- how many bits the resulting int may use
-
hash
public int hash(int hashcode) Description copied from interface:Hash
An incremental version of the hash function, that spreads a pre-calculated hash code, such as one derived fromObject.hashCode()
. -
hash
Description copied from interface:Hash
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). -
toString
-