Package org.atlanmod.commons.hash
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 aHashCodefrom byte sequences of arbitrary length.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default HashCodehash(boolean data)Calculates theHashCodeof the givendata.default HashCodehash(byte data)Calculates theHashCodeof the givendata.HashCodehash(byte[] data)Calculates theHashCodeof the givenbytearray.default HashCodehash(char data)Calculates theHashCodeof the givendata.default HashCodehash(double data)Calculates theHashCodeof the givendata.default HashCodehash(float data)Calculates theHashCodeof the givendata.default HashCodehash(int data)Calculates theHashCodeof the givendata.default HashCodehash(long data)Calculates theHashCodeof the givendata.default HashCodehash(short data)Calculates theHashCodeof the givendata.default HashCodehash(String data)Calculates theHashCodeof the givendata.
-
-
-
Method Detail
-
hash
@Nonnull default HashCode hash(byte data)
Calculates theHashCodeof the givendata.- Parameters:
data- thebyteto hash- Returns:
- a new hash code
-
hash
@Nonnull default HashCode hash(boolean data)
Calculates theHashCodeof the givendata.- Parameters:
data- thebooleanto hash- Returns:
- a new hash code
-
hash
@Nonnull default HashCode hash(char data)
Calculates theHashCodeof the givendata.- Parameters:
data- thecharto hash- Returns:
- a new hash code
-
hash
@Nonnull default HashCode hash(short data)
Calculates theHashCodeof the givendata.- Parameters:
data- theshortto hash- Returns:
- a new hash code
-
hash
@Nonnull default HashCode hash(int data)
Calculates theHashCodeof the givendata.- Parameters:
data- theintto hash- Returns:
- a new hash code
-
hash
@Nonnull default HashCode hash(long data)
Calculates theHashCodeof the givendata.- Parameters:
data- thelongto hash- Returns:
- a new hash code
-
hash
@Nonnull default HashCode hash(float data)
Calculates theHashCodeof the givendata.- Parameters:
data- thefloatto hash- Returns:
- a new hash code
-
hash
@Nonnull default HashCode hash(double data)
Calculates theHashCodeof the givendata.- Parameters:
data- thedoubleto hash- Returns:
- a new hash code
-
hash
@Nonnull default HashCode hash(String data)
Calculates theHashCodeof the givendata.- Parameters:
data- the string to hash- Returns:
- a new hash code
-
-