Package com.scurrilous.circe
Interface StatelessLongHash
-
- All Superinterfaces:
Hash
,StatelessHash
- All Known Subinterfaces:
IncrementalLongHash
- All Known Implementing Classes:
AbstractIncrementalLongHash
,AbstractLongCrc
,AbstractStatelessLongHash
,IntStatelessLongHash
,NormalLongCrc
,ReflectedLongCrc
public interface StatelessLongHash extends StatelessHash
Interface implemented by stateless hash functions with an output length greater than 4 bytes and less than or equal to 8 bytes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
calculate(byte[] input)
Evaluates this hash function for the entire given input array.long
calculate(byte[] input, int index, int length)
Evaluates this hash function for the given range of the given input array.long
calculate(long address, long length)
Evaluates this hash function for the memory with the given address and length.long
calculate(java.nio.ByteBuffer input)
Evaluates this hash function with the remaining contents of the given input buffer.StatefulLongHash
createStateful()
Returns a new instance of stateful version of this hash function.-
Methods inherited from interface com.scurrilous.circe.Hash
algorithm, length, supportsUnsafe
-
-
-
-
Method Detail
-
createStateful
StatefulLongHash createStateful()
Returns a new instance of stateful version of this hash function.- Specified by:
createStateful
in interfaceStatelessHash
- Returns:
- the stateful version of this hash function
-
calculate
long calculate(byte[] input)
Evaluates this hash function for the entire given input array.- Parameters:
input
- the input array- Returns:
- the output of the hash function
-
calculate
long calculate(byte[] input, int index, int length)
Evaluates this hash function for the given range of the given input array.- Parameters:
input
- the input arrayindex
- the starting index of the first input bytelength
- the length of the input range- Returns:
- the output of the hash function
- Throws:
java.lang.IndexOutOfBoundsException
- if index is negative orindex + length
is greater than the array length
-
calculate
long calculate(java.nio.ByteBuffer input)
Evaluates this hash function with the remaining contents of the given input buffer. This method leaves the buffer position at the limit.- Parameters:
input
- the input buffer- Returns:
- the output of the hash function
-
calculate
long calculate(long address, long length)
Evaluates this hash function for the memory with the given address and length. The arguments are generally not checked in any way and will likely lead to a VM crash or undefined results if invalid.- Parameters:
address
- the base address of the inputlength
- the length of the input- Returns:
- the output of the hash function
- Throws:
java.lang.UnsupportedOperationException
- if this function does not support unsafe memory access- See Also:
Hash.supportsUnsafe()
-
-