Interface Hasher

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    @ParametersAreNonnullByDefault
    public interface Hasher
    A hash function producing a HashCode from byte sequences of arbitrary length.
    • Method Detail

      • hash

        @Nonnull
        default HashCode hash​(byte data)
        Calculates the HashCode of the given data.
        Parameters:
        data - the byte to hash
        Returns:
        a new hash code
      • hash

        @Nonnull
        default HashCode hash​(boolean data)
        Calculates the HashCode of the given data.
        Parameters:
        data - the boolean to hash
        Returns:
        a new hash code
      • hash

        @Nonnull
        default HashCode hash​(char data)
        Calculates the HashCode of the given data.
        Parameters:
        data - the char to hash
        Returns:
        a new hash code
      • hash

        @Nonnull
        default HashCode hash​(short data)
        Calculates the HashCode of the given data.
        Parameters:
        data - the short to hash
        Returns:
        a new hash code
      • hash

        @Nonnull
        default HashCode hash​(int data)
        Calculates the HashCode of the given data.
        Parameters:
        data - the int to hash
        Returns:
        a new hash code
      • hash

        @Nonnull
        default HashCode hash​(long data)
        Calculates the HashCode of the given data.
        Parameters:
        data - the long to hash
        Returns:
        a new hash code
      • hash

        @Nonnull
        default HashCode hash​(float data)
        Calculates the HashCode of the given data.
        Parameters:
        data - the float to hash
        Returns:
        a new hash code
      • hash

        @Nonnull
        default HashCode hash​(double data)
        Calculates the HashCode of the given data.
        Parameters:
        data - the double to hash
        Returns:
        a new hash code
      • hash

        @Nonnull
        default HashCode hash​(String data)
        Calculates the HashCode of the given data.
        Parameters:
        data - the string to hash
        Returns:
        a new hash code
      • hash

        @Nonnull
        HashCode hash​(byte[] data)
        Calculates the HashCode of the given byte array.
        Parameters:
        data - the byte array to hash
        Returns:
        a new hash code