Package com.io7m.jmurmur
Class Murmur3
java.lang.Object
com.io7m.jmurmur.Murmur3
An implementation of the public domain Murmur3 hash function.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default seed if one is not explicitly given. -
Method Summary
Modifier and TypeMethodDescriptionstatic inthashInt(int x) Hash the given integer value using the default seed (@linkDEFAULT_SEED).static inthashIntWithSeed(int x, int seed) Hash the given integer value using the given seed to randomize the results.static inthashLong(long x) Hash the given long value using the default seed (@linkDEFAULT_SEED).static inthashLongWithSeed(long x, int seed) Hash the given long value using the given seed to randomize the results.
-
Field Details
-
DEFAULT_SEED
public static final int DEFAULT_SEEDThe default seed if one is not explicitly given. Just a large prime, no significance.- See Also:
-
-
Method Details
-
hashInt
public static int hashInt(int x) Hash the given integer value using the default seed (@linkDEFAULT_SEED).- Parameters:
x- The integer value.- Returns:
- A hash value.
-
hashIntWithSeed
public static int hashIntWithSeed(int x, int seed) Hash the given integer value using the given seed to randomize the results.- Parameters:
x- The integer value.seed- The seed value.- Returns:
- A hash value.
-
hashLong
public static int hashLong(long x) Hash the given long value using the default seed (@linkDEFAULT_SEED).- Parameters:
x- The long value.- Returns:
- A hash value.
-
hashLongWithSeed
public static int hashLongWithSeed(long x, int seed) Hash the given long value using the given seed to randomize the results.- Parameters:
x- The long value.seed- The seed value.- Returns:
- A hash value.
-