java.lang.Object
com.dynatrace.hash4j.hashing.HashValue128
Represents a 128-bit hash value. This class is immutable.
-
Constructor Summary
ConstructorsConstructorDescriptionHashValue128(long mostSignificantBits, long leastSignificantBits) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetAsInt()Returns the 32 least significant bits of the hash value.longReturns the 64 least significant bits of the hash value.longReturns the 64 least significant bits of the hash value.longReturns the 64 most significant bits of the hash value.inthashCode()byte[]Returns this hash value as byte array.toString()
-
Constructor Details
-
HashValue128
public HashValue128(long mostSignificantBits, long leastSignificantBits) Constructor.- Parameters:
mostSignificantBits- the 64 most significant bits of the hash valueleastSignificantBits- the 64 least significant bits of the hash value
-
-
Method Details
-
getAsInt
public int getAsInt()Returns the 32 least significant bits of the hash value.- Returns:
- a 32-bit hash value
-
getMostSignificantBits
public long getMostSignificantBits()Returns the 64 most significant bits of the hash value.- Returns:
- a 64-bit hash value
-
getLeastSignificantBits
public long getLeastSignificantBits()Returns the 64 least significant bits of the hash value.Equivalent to
getAsLong().- Returns:
- a 64-bit hash value
-
getAsLong
public long getAsLong()Returns the 64 least significant bits of the hash value.- Returns:
- a 64-bit hash value
-
hashCode
public int hashCode() -
equals
-
toString
-
toByteArray
public byte[] toByteArray()Returns this hash value as byte array.- Returns:
- a byte array of length 16
-