Package com.scurrilous.circe
Interface Hash
-
- All Known Subinterfaces:
IncrementalIntHash
,IncrementalLongHash
,StatefulHash
,StatefulIntHash
,StatefulLongHash
,StatelessHash
,StatelessIntHash
,StatelessLongHash
- All Known Implementing Classes:
AbstractIncrementalIntHash
,AbstractIncrementalLongHash
,AbstractIntCrc
,AbstractLongCrc
,AbstractStatefulHash
,AbstractStatelessIntHash
,AbstractStatelessLongHash
,IncrementalIntStatefulHash
,IncrementalLongStatefulHash
,IntStatefulLongHash
,IntStatelessLongHash
,JavaCrc32
,NormalByteCrc
,NormalIntCrc
,NormalLongCrc
,ReflectedIntCrc
,ReflectedLongCrc
,Sse42Crc32C
public interface Hash
Abstract hash function. Each actual hash function is provided using a stateful derived interface. Hash functions with an output length that fits within anint
or along
are also generally provided using a stateless derived interface. Given a stateless hash object, a method is provided for obtaining a new corresponding stateful object.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
algorithm()
Returns the canonical name of this hash algorithm.int
length()
Returns the length in bytes of the output of this hash function.boolean
supportsUnsafe()
Returns whether this hash function supports unsafe access to arbitrary memory addresses using methods such asStatefulHash.update(long, long)
,StatelessIntHash.calculate(long, long)
, orIncrementalIntHash.resume(int, long, long)
.
-
-
-
Method Detail
-
algorithm
java.lang.String algorithm()
Returns the canonical name of this hash algorithm.- Returns:
- the name of this hash algorithm
-
length
int length()
Returns the length in bytes of the output of this hash function.- Returns:
- the hash length in bytes
-
supportsUnsafe
boolean supportsUnsafe()
Returns whether this hash function supports unsafe access to arbitrary memory addresses using methods such asStatefulHash.update(long, long)
,StatelessIntHash.calculate(long, long)
, orIncrementalIntHash.resume(int, long, long)
. Such functions are generally implemented in native code.- Returns:
- true if unsafe access is supported, false if not
-
-