Package de.hybris.platform.util
Class MurmurHash
java.lang.Object
de.hybris.platform.util.MurmurHash
MurmurHash java implementation from http://d3s.mff.cuni.cz/~holub/sw/javamurmurhash/
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic inthash32(byte[] data, int length) Generates 32 bit hash from byte array with default seed value.static inthash32(byte[] data, int length, int seed) Generates 32 bit hash from byte array of the given length and seed.static intGenerates 32 bit hash from a string.static intGenerates 32 bit hash from a substring.static longhash64(byte[] data, int length) Generates 64 bit hash from byte array with default seed value.static longhash64(byte[] data, int length, int seed) Generates 64 bit hash from byte array of the given length and seed.static longGenerates 64 bit hash from a string.static longGenerates 64 bit hash from a substring.
-
Constructor Details
-
MurmurHash
public MurmurHash()
-
-
Method Details
-
hash32
public static int hash32(byte[] data, int length, int seed) Generates 32 bit hash from byte array of the given length and seed.- Parameters:
data- byte array to hashlength- length of the array to hashseed- initial seed value- Returns:
- 32 bit hash of the given array
-
hash32
public static int hash32(byte[] data, int length) Generates 32 bit hash from byte array with default seed value.- Parameters:
data- byte array to hashlength- length of the array to hash- Returns:
- 32 bit hash of the given array
-
hash32
Generates 32 bit hash from a string.- Parameters:
text- string to hash- Returns:
- 32 bit hash of the given string
-
hash32
Generates 32 bit hash from a substring.- Parameters:
text- string to hashfrom- starting indexlength- length of the substring to hash- Returns:
- 32 bit hash of the given string
-
hash64
public static long hash64(byte[] data, int length, int seed) Generates 64 bit hash from byte array of the given length and seed.- Parameters:
data- byte array to hashlength- length of the array to hashseed- initial seed value- Returns:
- 64 bit hash of the given array
-
hash64
public static long hash64(byte[] data, int length) Generates 64 bit hash from byte array with default seed value.- Parameters:
data- byte array to hashlength- length of the array to hash- Returns:
- 64 bit hash of the given string
-
hash64
Generates 64 bit hash from a string.- Parameters:
text- string to hash- Returns:
- 64 bit hash of the given string
-
hash64
Generates 64 bit hash from a substring.- Parameters:
text- string to hashfrom- starting indexlength- length of the substring to hash- Returns:
- 64 bit hash of the given array
-