Package org.apache.commons.codec.digest

# Class MurmurHash3.IncrementalHash32x86

java.lang.Object
org.apache.commons.codec.digest.MurmurHash3.IncrementalHash32x86

Direct Known Subclasses:
  `MurmurHash3.IncrementalHash32`

Enclosing class:
  `MurmurHash3`

public static class MurmurHash3.IncrementalHash32x86 extends Object
Generates 32-bit hash from input bytes. Bytes can be added incrementally and the new hash computed.

This is an implementation of the 32-bit hash function `MurmurHash3_x86_32` from Austin Appleby's original MurmurHash3 `c++` code in SMHasher.

Since:
  1.14

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IncrementalHash32x86()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final void`
  `add(byte[] data, int offset, int length)`
  Adds the byte array to the current incremental hash.
  `final int`
  `end()`
  Generates the 32-bit hash value.
  `final void`
  `start(int seed)`
  Starts a new incremental hash.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### IncrementalHash32x86

    public IncrementalHash32x86()
    Constructs a new instance.

- ## Method Details

  - ### add

    public final void add(byte[] data, int offset, int length)
    Adds the byte array to the current incremental hash.
    Parameters:
      `data` - The input byte array
      `offset` - The offset of data
      `length` - The length of array

  - ### end

    public final int end()
    Generates the 32-bit hash value. Repeat calls to this method with no additional data will generate the same hash value.
    Returns:
      The 32-bit hash

  - ### start

    public final void start(int seed)
    Starts a new incremental hash.
    Parameters:
      `seed` - The initial seed value