Module hash4j

Interface HashStream128

All Superinterfaces:
HashSink, HashStream32, HashStream64

public interface HashStream128 extends HashStream64
A hash stream computing a 128-bit hash value.
  • Method Details

    • get

      Returns a 128-bit hash value.

      get().getAsLong() will be equivalent to HashStream64.getAsLong().

      Returns:
      a 128-bit hash value
    • putByte

      HashStream128 putByte(byte v)
      Description copied from interface: HashSink
      Adds a byte value to the hash computation.
      Specified by:
      putByte in interface HashSink
      Specified by:
      putByte in interface HashStream32
      Specified by:
      putByte in interface HashStream64
      Parameters:
      v - the value
      Returns:
      this
    • putBytes

      HashStream128 putBytes(byte[] x)
      Description copied from interface: HashSink
      Adds all elements of a byte array to the hash computation.

      Unlike HashSink.putByteArray(byte[]) this method does not add the length of the array.

      If the array has variable length, and it is just one of many variable-length fields of the object for which a hash value is calculated, it is highly recommended to also incorporate the length of the array to improve the hash quality and decrease the chance of hash collisions.

      Equivalent to
      putBytes(x, 0, x.length);

      Specified by:
      putBytes in interface HashSink
      Specified by:
      putBytes in interface HashStream32
      Specified by:
      putBytes in interface HashStream64
      Parameters:
      x - the array
      Returns:
      this
    • putBytes

      HashStream128 putBytes(byte[] x, int off, int len)
      Description copied from interface: HashSink
      Adds len elements of the given byte array to the hash computation.

      Equivalent to
      for (int i = 0; i < len; i++) putByte(x[off + i]);

      Specified by:
      putBytes in interface HashSink
      Specified by:
      putBytes in interface HashStream32
      Specified by:
      putBytes in interface HashStream64
      Parameters:
      x - the array
      off - the start offset in the array
      len - the number of elements
      Returns:
      this
    • putBytes

      <T> HashStream128 putBytes(T b, long off, long len, ByteAccess<T> access)
      Description copied from interface: HashSink
      Adds a sequence of bytes to the hash computation.

      Equivalent to
      for (int i = 0; i < len; i++) putByte(access.getByte(input, off + i));

      Specified by:
      putBytes in interface HashSink
      Specified by:
      putBytes in interface HashStream32
      Specified by:
      putBytes in interface HashStream64
      Type Parameters:
      T - the type of the input
      Parameters:
      b - the input
      off - the offset
      len - the length
      access - a strategy to access the bytes of the input
      Returns:
      this
    • putByteArray

      HashStream128 putByteArray(byte[] x)
      Description copied from interface: HashSink
      Adds a byte array to the hash computation.

      This method includes the length information. In this way,

      hashSink.putByteArray(new byte[]{1, 2}).putByteArray(new byte[]{3})

      and

      hashSink.putByteArray(new byte[]{1}).putByteArray(new byte[]{2, 3})

      will be different contributions to the hash value computation.

      Equivalent to
      putBytes(x).putInt(x.length);

      Specified by:
      putByteArray in interface HashSink
      Specified by:
      putByteArray in interface HashStream32
      Specified by:
      putByteArray in interface HashStream64
      Parameters:
      x - the boolean array
      Returns:
      this
    • putBoolean

      HashStream128 putBoolean(boolean v)
      Description copied from interface: HashSink
      Adds a boolean value to the hash computation.

      Equivalent to
      putByte(v ? 1 : 0);

      Specified by:
      putBoolean in interface HashSink
      Specified by:
      putBoolean in interface HashStream32
      Specified by:
      putBoolean in interface HashStream64
      Parameters:
      v - the value
      Returns:
      this
    • putBooleans

      HashStream128 putBooleans(boolean[] x)
      Description copied from interface: HashSink
      Adds all elements of a boolean array to the hash computation.

      Unlike HashSink.putBooleanArray(boolean[]) this method does not add the length of the array.

      If the array has variable length, and it is just one of many variable-length fields of the object for which a hash value is calculated, it is highly recommended to also incorporate the length of the array to improve the hash quality and decrease the chance of hash collisions.

      Equivalent to
      putBooleans(x, 0, x.length);

      Specified by:
      putBooleans in interface HashSink
      Specified by:
      putBooleans in interface HashStream32
      Specified by:
      putBooleans in interface HashStream64
      Parameters:
      x - the array
      Returns:
      this
    • putBooleans

      HashStream128 putBooleans(boolean[] x, int off, int len)
      Description copied from interface: HashSink
      Adds len elements of the given boolean array to the hash computation.

      Equivalent to
      for (int i = 0; i < len; i++) putBoolean(x[off + i]);

      Specified by:
      putBooleans in interface HashSink
      Specified by:
      putBooleans in interface HashStream32
      Specified by:
      putBooleans in interface HashStream64
      Parameters:
      x - the array
      off - the start offset in the array
      len - the number of elements
      Returns:
      this
    • putBooleanArray

      HashStream128 putBooleanArray(boolean[] x)
      Description copied from interface: HashSink
      Adds a boolean array to the hash computation.

      This method includes the length information. In this way,

      hashSink.putBooleanArray(new boolean[]{true, false}).putBooleanArray(new boolean[]{true})

      and

      hashSink.putBooleanArray(new boolean[]{true}).putBooleanArray(new boolean[]{false, true})

      will be different contributions to the hash value computation.

      Equivalent to
      putBooleans(x).putInt(x.length);

      Specified by:
      putBooleanArray in interface HashSink
      Specified by:
      putBooleanArray in interface HashStream32
      Specified by:
      putBooleanArray in interface HashStream64
      Parameters:
      x - the boolean array
      Returns:
      this
    • putShort

      HashStream128 putShort(short v)
      Description copied from interface: HashSink
      Adds a short value to the hash computation using little-endian byte order.
      Specified by:
      putShort in interface HashSink
      Specified by:
      putShort in interface HashStream32
      Specified by:
      putShort in interface HashStream64
      Parameters:
      v - the value
      Returns:
      this
    • putShorts

      HashStream128 putShorts(short[] x)
      Description copied from interface: HashSink
      Adds all elements of a short array to the hash computation.

      Unlike HashSink.putShortArray(short[]) this method does not add the length of the array.

      If the array has variable length, and it is just one of many variable-length fields of the object for which a hash value is calculated, it is highly recommended to also incorporate the length of the array to improve the hash quality and decrease the chance of hash collisions.

      Equivalent to
      putShorts(x, 0, x.length);

      Specified by:
      putShorts in interface HashSink
      Specified by:
      putShorts in interface HashStream32
      Specified by:
      putShorts in interface HashStream64
      Parameters:
      x - the array
      Returns:
      this
    • putShorts

      HashStream128 putShorts(short[] x, int off, int len)
      Description copied from interface: HashSink
      Adds len elements of the given short array to the hash computation.

      Equivalent to
      for (int i = 0; i < len; i++) putShort(x[off + i]);

      Specified by:
      putShorts in interface HashSink
      Specified by:
      putShorts in interface HashStream32
      Specified by:
      putShorts in interface HashStream64
      Parameters:
      x - the array
      off - the start offset in the array
      len - the number of elements
      Returns:
      this
    • putShortArray

      HashStream128 putShortArray(short[] x)
      Description copied from interface: HashSink
      Adds a short array to the hash computation.

      This method includes the length information. In this way,

      hashSink.putShortArray(new short[]{1, 2}).putShortArray(new short[]{3})

      and

      hashSink.putShortArray(new short[]{1}).putShortArray(new short[]{2, 3})

      will be different contributions to the hash value computation.

      Equivalent to
      putShorts(x).putInt(x.length);

      Specified by:
      putShortArray in interface HashSink
      Specified by:
      putShortArray in interface HashStream32
      Specified by:
      putShortArray in interface HashStream64
      Parameters:
      x - the short array
      Returns:
      this
    • putChar

      HashStream128 putChar(char v)
      Description copied from interface: HashSink
      Adds a char value to the hash computation using little-endian byte order.
      Specified by:
      putChar in interface HashSink
      Specified by:
      putChar in interface HashStream32
      Specified by:
      putChar in interface HashStream64
      Parameters:
      v - the value
      Returns:
      this
    • putChars

      HashStream128 putChars(char[] x)
      Description copied from interface: HashSink
      Adds all elements of a char array to the hash computation.

      Unlike HashSink.putCharArray(char[]) this method does not add the length of the array.

      If the array has variable length, and it is just one of many variable-length fields of the object for which a hash value is calculated, it is highly recommended to also incorporate the length of the array to improve the hash quality and decrease the chance of hash collisions.

      Equivalent to
      putChars(x, 0, x.length);

      Specified by:
      putChars in interface HashSink
      Specified by:
      putChars in interface HashStream32
      Specified by:
      putChars in interface HashStream64
      Parameters:
      x - the array
      Returns:
      this
    • putChars

      HashStream128 putChars(char[] x, int off, int len)
      Description copied from interface: HashSink
      Adds len elements of the given char array to the hash computation.

      Equivalent to
      for (int i = 0; i < len; i++) putChar(x[off + i]);

      Specified by:
      putChars in interface HashSink
      Specified by:
      putChars in interface HashStream32
      Specified by:
      putChars in interface HashStream64
      Parameters:
      x - the array
      off - the start offset in the array
      len - the number of elements
      Returns:
      this
    • putChars

      Description copied from interface: HashSink
      Adds chars to the hash computation.

      This method does not include the length information. In this way,

      hashSink.putChars("AB").putChars("C")

      and

      hashSink.putChars("A").putChars("BC")

      will be equivalent contributions to the hash value computation.

      Equivalent to
      for (int i = 0; i < s.length(); ++i) putChar(s.charAt(i));

      Specified by:
      putChars in interface HashSink
      Specified by:
      putChars in interface HashStream32
      Specified by:
      putChars in interface HashStream64
      Parameters:
      c - a char sequence
      Returns:
      this
    • putCharArray

      HashStream128 putCharArray(char[] x)
      Description copied from interface: HashSink
      Adds a char array to the hash computation.

      This method includes the length information. In this way,

      hashSink.putCharArray(new char[]{'A', 'B'}).putCharArray(new char[]{'C'})

      and

      hashSink.putCharArray(new char[]{'A'}).putCharArray(new char[]{'B', 'C'})

      will be different contributions to the hash value computation.

      Equivalent to
      putChars(x).putInt(x.length);

      Specified by:
      putCharArray in interface HashSink
      Specified by:
      putCharArray in interface HashStream32
      Specified by:
      putCharArray in interface HashStream64
      Parameters:
      x - the char array
      Returns:
      this
    • putString

      HashStream128 putString(String s)
      Description copied from interface: HashSink
      Adds a string to the hash computation.

      This method includes the length information. In this way,

      hashSink.putString("AB").putString("C")

      and

      hashSink.putString("A").putString("BC")

      will be different contributions to the hash value computation.

      Equivalent to
      putChars(s).putInt(s.length());

      Specified by:
      putString in interface HashSink
      Specified by:
      putString in interface HashStream32
      Specified by:
      putString in interface HashStream64
      Parameters:
      s - the string
      Returns:
      this
    • putInt

      HashStream128 putInt(int v)
      Description copied from interface: HashSink
      Adds an int value to the hash computation using little-endian byte order.
      Specified by:
      putInt in interface HashSink
      Specified by:
      putInt in interface HashStream32
      Specified by:
      putInt in interface HashStream64
      Parameters:
      v - the value
      Returns:
      this
    • putInts

      HashStream128 putInts(int[] x)
      Description copied from interface: HashSink
      Adds all elements of an int array to the hash computation.

      Unlike HashSink.putIntArray(int[]) this method does not add the length of the array.

      If the array has variable length, and it is just one of many variable-length fields of the object for which a hash value is calculated, it is highly recommended to also incorporate the length of the array to improve the hash quality and decrease the chance of hash collisions.

      Equivalent to
      putInts(x, 0, x.length);

      Specified by:
      putInts in interface HashSink
      Specified by:
      putInts in interface HashStream32
      Specified by:
      putInts in interface HashStream64
      Parameters:
      x - the array
      Returns:
      this
    • putInts

      HashStream128 putInts(int[] x, int off, int len)
      Description copied from interface: HashSink
      Adds len elements of the given int array to the hash computation.

      Equivalent to
      for (int i = 0; i < len; i++) putInt(x[off + i]);

      Specified by:
      putInts in interface HashSink
      Specified by:
      putInts in interface HashStream32
      Specified by:
      putInts in interface HashStream64
      Parameters:
      x - the array
      off - the start offset in the array
      len - the number of elements
      Returns:
      this
    • putIntArray

      HashStream128 putIntArray(int[] x)
      Description copied from interface: HashSink
      Adds an int array to the hash computation.

      This method includes the length information. In this way,

      hashSink.putIntArray(new int[]{1, 2}).putIntArray(new int[]{3})

      and

      hashSink.putIntArray(new int[]{1}).putIntArray(new int[]{2, 3})

      will be different contributions to the hash value computation.

      Equivalent to
      putInts(x).putInt(x.length);

      Specified by:
      putIntArray in interface HashSink
      Specified by:
      putIntArray in interface HashStream32
      Specified by:
      putIntArray in interface HashStream64
      Parameters:
      x - the int array
      Returns:
      this
    • putLong

      HashStream128 putLong(long v)
      Description copied from interface: HashSink
      Adds along long value to the hash computation using little-endian byte order.
      Specified by:
      putLong in interface HashSink
      Specified by:
      putLong in interface HashStream32
      Specified by:
      putLong in interface HashStream64
      Parameters:
      v - the value
      Returns:
      this
    • putLongs

      HashStream128 putLongs(long[] x)
      Description copied from interface: HashSink
      Adds all elements of a long array to the hash computation.

      Unlike HashSink.putLongArray(long[]) this method does not add the length of the array.

      If the array has variable length, and it is just one of many variable-length fields of the object for which a hash value is calculated, it is highly recommended to also incorporate the length of the array to improve the hash quality and decrease the chance of hash collisions.

      Equivalent to
      putLongs(x, 0, x.length);

      Specified by:
      putLongs in interface HashSink
      Specified by:
      putLongs in interface HashStream32
      Specified by:
      putLongs in interface HashStream64
      Parameters:
      x - the array
      Returns:
      this
    • putLongs

      HashStream128 putLongs(long[] x, int off, int len)
      Description copied from interface: HashSink
      Adds len elements of the given long array to the hash computation.

      Equivalent to
      for (int i = 0; i < len; i++) putLong(x[off + i]);

      Specified by:
      putLongs in interface HashSink
      Specified by:
      putLongs in interface HashStream32
      Specified by:
      putLongs in interface HashStream64
      Parameters:
      x - the array
      off - the start offset in the array
      len - the number of elements
      Returns:
      this
    • putLongArray

      HashStream128 putLongArray(long[] x)
      Description copied from interface: HashSink
      Adds a long array to the hash computation.

      This method includes the length information. In this way,

      hashSink.putLongArray(new long[]{1, 2}).putLongArray(new long[]{3})

      and

      hashSink.putLongArray(new long[]{1}).putLongArray(new long[]{2, 3})

      will be different contributions to the hash value computation.

      Equivalent to
      putLongs(x).putInt(x.length);

      Specified by:
      putLongArray in interface HashSink
      Specified by:
      putLongArray in interface HashStream32
      Specified by:
      putLongArray in interface HashStream64
      Parameters:
      x - the int array
      Returns:
      this
    • putFloat

      HashStream128 putFloat(float v)
      Description copied from interface: HashSink
      Adds a float value to the hash computation using little-endian byte order.

      Equivalent to
      putInt(Float.floatToRawIntBits(v));

      Specified by:
      putFloat in interface HashSink
      Specified by:
      putFloat in interface HashStream32
      Specified by:
      putFloat in interface HashStream64
      Parameters:
      v - the value
      Returns:
      this
    • putFloats

      HashStream128 putFloats(float[] x)
      Description copied from interface: HashSink
      Adds all elements of a float array to the hash computation.

      Unlike HashSink.putFloatArray(float[]) this method does not add the length of the array.

      If the array has variable length, and it is just one of many variable-length fields of the object for which a hash value is calculated, it is highly recommended to also incorporate the length of the array to improve the hash quality and decrease the chance of hash collisions.

      Equivalent to
      putFloats(x, 0, x.length);

      Specified by:
      putFloats in interface HashSink
      Specified by:
      putFloats in interface HashStream32
      Specified by:
      putFloats in interface HashStream64
      Parameters:
      x - the array
      Returns:
      this
    • putFloats

      HashStream128 putFloats(float[] x, int off, int len)
      Description copied from interface: HashSink
      Adds len elements of the given float array to the hash computation.

      Equivalent to
      for (int i = 0; i < len; i++) putFloat(x[off + i]);

      Specified by:
      putFloats in interface HashSink
      Specified by:
      putFloats in interface HashStream32
      Specified by:
      putFloats in interface HashStream64
      Parameters:
      x - the array
      off - the start offset in the array
      len - the number of elements
      Returns:
      this
    • putFloatArray

      HashStream128 putFloatArray(float[] x)
      Description copied from interface: HashSink
      Adds a float array to the hash computation.

      This method includes the length information. In this way,

      hashSink.putFloatArray(new float[]{1, 2}).putFloatArray(new float[]{3})

      and

      hashSink.putFloatArray(new float[]{1}).putFloatArray(new float[]{2, 3})

      will be different contributions to the hash value computation.

      Equivalent to
      putFloats(x).putInt(x.length);

      Specified by:
      putFloatArray in interface HashSink
      Specified by:
      putFloatArray in interface HashStream32
      Specified by:
      putFloatArray in interface HashStream64
      Parameters:
      x - the float array
      Returns:
      this
    • putDouble

      HashStream128 putDouble(double v)
      Description copied from interface: HashSink
      Adds a double value to the hash computation using little-endian byte order.

      Equivalent to
      putLong(Double.doubleToRawLongBits(v));

      Specified by:
      putDouble in interface HashSink
      Specified by:
      putDouble in interface HashStream32
      Specified by:
      putDouble in interface HashStream64
      Parameters:
      v - the value
      Returns:
      this
    • putDoubles

      HashStream128 putDoubles(double[] x)
      Description copied from interface: HashSink
      Adds all elements of a double array to the hash computation.

      Unlike HashSink.putDoubleArray(double[]) this method does not add the length of the array.

      If the array has variable length, and it is just one of many variable-length fields of the object for which a hash value is calculated, it is highly recommended to also incorporate the length of the array to improve the hash quality and decrease the chance of hash collisions.

      Equivalent to
      putDoubles(x, 0, x.length);

      Specified by:
      putDoubles in interface HashSink
      Specified by:
      putDoubles in interface HashStream32
      Specified by:
      putDoubles in interface HashStream64
      Parameters:
      x - the array
      Returns:
      this
    • putDoubles

      HashStream128 putDoubles(double[] x, int off, int len)
      Description copied from interface: HashSink
      Adds len elements of the given double array to the hash computation.

      Equivalent to
      for (int i = 0; i < len; i++) putDouble(x[off + i]);

      Specified by:
      putDoubles in interface HashSink
      Specified by:
      putDoubles in interface HashStream32
      Specified by:
      putDoubles in interface HashStream64
      Parameters:
      x - the array
      off - the start offset in the array
      len - the number of elements
      Returns:
      this
    • putDoubleArray

      HashStream128 putDoubleArray(double[] x)
      Description copied from interface: HashSink
      Adds a double array to the hash computation.

      This method includes the length information. In this way,

      hashSink.putDoubleArray(new double[]{1, 2}).putDoubleArray(new double[]{3})

      and

      hashSink.putDoubleArray(new double[]{1}).putDoubleArray(new double[]{2, 3})

      will be different contributions to the hash value computation.

      Equivalent to
      putDoubles(x).putInt(x.length);

      Specified by:
      putDoubleArray in interface HashSink
      Specified by:
      putDoubleArray in interface HashStream32
      Specified by:
      putDoubleArray in interface HashStream64
      Parameters:
      x - the double array
      Returns:
      this
    • putUUID

      HashStream128 putUUID(UUID uuid)
      Description copied from interface: HashSink
      Adds a UUID to the hash computation.

      Equivalent to
      putLong(uuid.getLeastSignificantBits()).putLong(uuid.getMostSignificantBits());

      Specified by:
      putUUID in interface HashSink
      Specified by:
      putUUID in interface HashStream32
      Specified by:
      putUUID in interface HashStream64
      Parameters:
      uuid - the UUID
      Returns:
      this
    • put

      <T> HashStream128 put(T obj, HashFunnel<T> funnel)
      Description copied from interface: HashSink
      Adds an object to the hash computation using the given funnel.
      Specified by:
      put in interface HashSink
      Specified by:
      put in interface HashStream32
      Specified by:
      put in interface HashStream64
      Type Parameters:
      T - the type
      Parameters:
      obj - the object
      funnel - the funnel
      Returns:
      this
    • putNullable

      <T> HashStream128 putNullable(T obj, HashFunnel<T> funnel)
      Description copied from interface: HashSink
      Adds a nullable object to the hash computation using the given funnel.
      Specified by:
      putNullable in interface HashSink
      Specified by:
      putNullable in interface HashStream32
      Specified by:
      putNullable in interface HashStream64
      Type Parameters:
      T - the type
      Parameters:
      obj - the nullable object
      funnel - the funnel
      Returns:
      this
    • putOrderedIterable

      <T> HashStream128 putOrderedIterable(Iterable<T> data, HashFunnel<? super T> funnel)
      Description copied from interface: HashSink
      Adds an ordered Iterable (e.g. List) to the hash computation.
      Specified by:
      putOrderedIterable in interface HashSink
      Specified by:
      putOrderedIterable in interface HashStream64
      Type Parameters:
      T - the element type
      Parameters:
      data - the iterable
      funnel - the funnel
      Returns:
      this
    • putUnorderedIterable

      <T> HashStream128 putUnorderedIterable(Iterable<T> data, ToLongFunction<? super T> elementHashFunction)
      Description copied from interface: HashSink
      Adds an unordered Iterable (e.g. Set) to the hash computation.
      Specified by:
      putUnorderedIterable in interface HashSink
      Specified by:
      putUnorderedIterable in interface HashStream32
      Specified by:
      putUnorderedIterable in interface HashStream64
      Type Parameters:
      T - the element type
      Parameters:
      data - the iterable
      elementHashFunction - 64-bit hash function used for individual elements
      Returns:
      this
    • putUnorderedIterable

      <T> HashStream128 putUnorderedIterable(Iterable<T> data, HashFunnel<? super T> funnel, Hasher64 hasher)
      Description copied from interface: HashSink
      Adds an unordered Iterable (e.g. Set) to the hash computation.
      Specified by:
      putUnorderedIterable in interface HashSink
      Specified by:
      putUnorderedIterable in interface HashStream32
      Specified by:
      putUnorderedIterable in interface HashStream64
      Type Parameters:
      T - the element type
      Parameters:
      data - the iterable
      funnel - the funnel
      hasher - a 64-bit hasher
      Returns:
      this
    • putOptional

      <T> HashStream128 putOptional(Optional<T> obj, HashFunnel<? super T> funnel)
      Description copied from interface: HashSink
      Adds an optional object to the hash computation using the given funnel.
      Specified by:
      putOptional in interface HashSink
      Specified by:
      putOptional in interface HashStream32
      Specified by:
      putOptional in interface HashStream64
      Type Parameters:
      T - the type
      Parameters:
      obj - the optional object
      funnel - the funnel
      Returns:
      this
    • putOptionalInt

      HashStream128 putOptionalInt(OptionalInt v)
      Description copied from interface: HashSink
      Adds an OptionalInt to the hash computation.
      Specified by:
      putOptionalInt in interface HashSink
      Specified by:
      putOptionalInt in interface HashStream32
      Specified by:
      putOptionalInt in interface HashStream64
      Parameters:
      v - the optional value
      Returns:
      this
    • putOptionalLong

      HashStream128 putOptionalLong(OptionalLong v)
      Description copied from interface: HashSink
      Adds an OptionalLong to the hash computation.
      Specified by:
      putOptionalLong in interface HashSink
      Specified by:
      putOptionalLong in interface HashStream32
      Specified by:
      putOptionalLong in interface HashStream64
      Parameters:
      v - the optional value
      Returns:
      this
    • putOptionalDouble

      HashStream128 putOptionalDouble(OptionalDouble v)
      Description copied from interface: HashSink
      Adds an OptionalDouble to the hash computation.
      Specified by:
      putOptionalDouble in interface HashSink
      Specified by:
      putOptionalDouble in interface HashStream32
      Specified by:
      putOptionalDouble in interface HashStream64
      Parameters:
      v - the optional value
      Returns:
      this
    • reset

      HashStream128 reset()
      Description copied from interface: HashStream32
      Resets the hash stream.

      This allows to reuse this instance for new hash computations.

      Specified by:
      reset in interface HashStream32
      Specified by:
      reset in interface HashStream64
      Returns:
      this
    • copy

      Description copied from interface: HashStream32
      Creates a copy of this hash stream.

      This allows to save the current state for reuse, without new hash computations.

      Equivalent to getHasher().hashStreamFromState(getState()).

      Specified by:
      copy in interface HashStream32
      Specified by:
      copy in interface HashStream64
      Returns:
      new instance
    • resetAndHashTo128Bits

      <T> HashValue128 resetAndHashTo128Bits(T obj, HashFunnel<T> funnel)
      Resets this hash stream and returns a 128-bit hash value of the given object using the given funnel.

      Equivalent to funnel.put(obj, reset()); return get();

      Type Parameters:
      T - the type
      Parameters:
      obj - the object
      funnel - the funnel
      Returns:
      a 128-bit hash value
    • getHasher

      Hasher128 getHasher()
      Description copied from interface: HashStream32
      Returns a reference of the underlying hasher.
      Specified by:
      getHasher in interface HashStream32
      Specified by:
      getHasher in interface HashStream64
      Returns:
      a reference to the underlying hasher
    • getState

      byte[] getState()
      Description copied from interface: HashStream32
      Returns the state of the hash stream.

      The state allows to continue the processing after creating a new instance using the hashStreamFromState(byte[]) of the corresponding hasher instance or initializing an existing instance using HashStream32.setState(byte[]).

      Specified by:
      getState in interface HashStream32
      Specified by:
      getState in interface HashStream64
      Returns:
      the state
    • setState

      HashStream128 setState(byte[] state)
      Description copied from interface: HashStream32
      Sets the state of the hash stream.

      The behavior is undefined, if the given state was not created by a hash stream of a hasher that is equal to HashStream32.getHasher().

      Specified by:
      setState in interface HashStream32
      Specified by:
      setState in interface HashStream64
      Parameters:
      state - the state
      Returns:
      a reference to the underlying hasher
    • getHashBitSize

      int getHashBitSize()
      The size of the hash value in bits.
      Returns:
      the size of the hash value in bits