Package com.scurrilous.circe
Interface HashProvider
-
- All Known Implementing Classes:
AbstractHashProvider
,Crc32cSse42Provider
,StandardCrcProvider
public interface HashProvider
Interface used to obtain instances of various kinds of hash algorithms.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StatefulHash
createStateful(HashParameters params)
Creates a stateful hash function using the given parameters.IncrementalIntHash
getIncrementalInt(HashParameters params)
Requests an incremental, stateless, int-width hash function with the given parameters.IncrementalLongHash
getIncrementalLong(HashParameters params)
Requests an incremental, stateless, long-width hash function with the given parameters.StatelessIntHash
getStatelessInt(HashParameters params)
Requests a stateless, int-width hash function with the given parameters.StatelessLongHash
getStatelessLong(HashParameters params)
Requests a stateless, long-width hash function with the given parameters.java.util.EnumSet<HashSupport>
querySupport(HashParameters params)
Returns information about the available implementations corresponding to the given hash algorithm parameters.
-
-
-
Method Detail
-
querySupport
java.util.EnumSet<HashSupport> querySupport(HashParameters params)
Returns information about the available implementations corresponding to the given hash algorithm parameters.- Parameters:
params
- the hash algorithm parameters- Returns:
- a set of flags indicating the level of support
-
createStateful
StatefulHash createStateful(HashParameters params)
Creates a stateful hash function using the given parameters.- Parameters:
params
- the hash algorithm parameters- Returns:
- a stateful hash function
- Throws:
java.lang.UnsupportedOperationException
- if this provider cannot support the given parameters
-
getStatelessInt
StatelessIntHash getStatelessInt(HashParameters params)
Requests a stateless, int-width hash function with the given parameters. Because not all stateless hash functions are incremental, this method may be able to return implementations not supported by or more optimized thangetIncrementalInt(com.scurrilous.circe.HashParameters)
.- Parameters:
params
- the hash algorithm parameters- Returns:
- a stateless int-width hash function
- Throws:
java.lang.UnsupportedOperationException
- if this provider cannot support the given parameters
-
getStatelessLong
StatelessLongHash getStatelessLong(HashParameters params)
Requests a stateless, long-width hash function with the given parameters. Because not all stateless hash functions are incremental, this method may be able to return implementations not supported by or more optimized thangetIncrementalLong(com.scurrilous.circe.HashParameters)
.Note that this method may return a less efficient hash function than
getStatelessInt(com.scurrilous.circe.HashParameters)
for hashes of 32 bits or less.- Parameters:
params
- the hash algorithm parameters- Returns:
- a stateless long-width hash function
- Throws:
java.lang.UnsupportedOperationException
- if this provider cannot support the given parameters
-
getIncrementalInt
IncrementalIntHash getIncrementalInt(HashParameters params)
Requests an incremental, stateless, int-width hash function with the given parameters. Note that although an algorithm may be available in incremental form, some potentially more optimized implementations may not support that form, and therefore cannot be provided be this method.- Parameters:
params
- the hash algorithm parameters- Returns:
- a stateful int-width hash function
- Throws:
java.lang.UnsupportedOperationException
- if this provider cannot support the given parameters
-
getIncrementalLong
IncrementalLongHash getIncrementalLong(HashParameters params)
Requests an incremental, stateless, long-width hash function with the given parameters. Note that although an algorithm may be available in incremental form, some potentially more optimized implementations may not support that form, and therefore cannot be provided be this method.Also note that this method may return a less efficient hash function than
getIncrementalInt(com.scurrilous.circe.HashParameters)
for hashes of 32 bits or less.- Parameters:
params
- the hash algorithm parameters- Returns:
- a stateful long-width hash function
- Throws:
java.lang.UnsupportedOperationException
- if this provider cannot support the given parameters
-
-