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 an int or a long 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 Details

    • algorithm

      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 as StatefulHash.update(long, long), StatelessIntHash.calculate(long, long), or IncrementalIntHash.resume(int, long, long). Such functions are generally implemented in native code.
      Returns:
      true if unsafe access is supported, false if not