
public final class HashUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
private static Charset |
CHARSET |
private static int |
MASK_BYTE |
private static com.google.common.hash.HashFunction |
MURMUR128 |
private static com.google.common.hash.HashFunction |
MURMUR32 |
private static int |
SHIFT3 |
private static int |
SHIFT4 |
private static int |
SHIFT5 |
private static int |
SHIFT6 |
private static int |
SHIFT7 |
| Modifier | Constructor and Description |
|---|---|
private |
HashUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
djb2int32(byte... bytes) |
static int |
djb2int32(double... bytes) |
static int |
djb2int32(int... bytes) |
static int |
djb2int32obj(Serializable... bytes)
Deprecated.
This method may perform very badly, since it serializes objects in-memory. Prefer
hash32(Object...). |
static long |
djb2long64(byte... bytes) |
static long |
djb2long64(double... bytes) |
static long |
djb2long64(int... bytes) |
static long |
djb2long64obj(Serializable... bytes)
Deprecated.
This method may perform very badly, since it serializes objects in-memory. Prefer
hash64(Object...). |
static int |
hash32(CharSequence data)
Computes a 32bit hash.
|
static int |
hash32(double data)
Computes a 32bit hash.
|
static int |
hash32(Double data)
Computes a 32bit hash.
|
static int |
hash32(float data)
Computes a 32bit hash.
|
static int |
hash32(Float data)
Computes a 32bit hash.
|
static int |
hash32(Integer data)
Computes a 32bit hash.
|
static int |
hash32(long data)
Computes a 32bit hash.
|
static int |
hash32(Long data)
Computes a 32bit hash.
|
static int |
hash32(Object... data)
Computes a 32bit hash.
|
static long |
hash64(CharSequence data)
Computes a 64bit hash.
|
static long |
hash64(double data)
Computes a 64bit hash.
|
static long |
hash64(Double data)
Computes a 64bit hash.
|
static long |
hash64(float data)
Computes a 64bit hash.
|
static long |
hash64(Float data)
Computes a 64bit hash.
|
static long |
hash64(Integer data)
Computes a 64bit hash.
|
static long |
hash64(long data)
Computes a 64bit hash.
|
static long |
hash64(Long data)
Computes a 64bit hash.
|
static long |
hash64(Object... data)
Computes a 64bit hash.
|
static boolean |
pointerEquals(Object a,
Object b)
Runs System.identityHashCode(a) == System.identityHashCode(b).
|
private static void |
populateHasher(Object data,
com.google.common.hash.Hasher h) |
static byte[] |
toByta(double data) |
static byte[] |
toByta(double[] data) |
static byte[] |
toByta(float data) |
static byte[] |
toByta(float[] data) |
static byte[] |
toByta(int data) |
static byte[] |
toByta(int[] data) |
static byte[] |
toByta(long data) |
static byte[] |
toByta(long[] data) |
private static final com.google.common.hash.HashFunction MURMUR32
private static final com.google.common.hash.HashFunction MURMUR128
private static final Charset CHARSET
private static final int MASK_BYTE
private static final int SHIFT3
private static final int SHIFT4
private static final int SHIFT5
private static final int SHIFT6
private static final int SHIFT7
public static int hash32(double data)
data - the data to hashpublic static int hash32(long data)
data - the data to hashpublic static int hash32(float data)
data - the data to hashpublic static int hash32(CharSequence data)
data - the data to hashpublic static int hash32(Integer data)
data - the data to hashpublic static int hash32(Float data)
data - the data to hashpublic static int hash32(Double data)
data - the data to hashpublic static int hash32(Long data)
data - the data to hashpublic static int hash32(Object... data)
data - the data to hashpublic static long hash64(double data)
data - the data to hashpublic static long hash64(long data)
data - the data to hashpublic static long hash64(float data)
data - the data to hashpublic static long hash64(CharSequence data)
data - the data to hashpublic static long hash64(Integer data)
data - the data to hashpublic static long hash64(Float data)
data - the data to hashpublic static long hash64(Double data)
data - the data to hashpublic static long hash64(Long data)
data - the data to hashpublic static long hash64(Object... data)
data - the data to hashprivate static void populateHasher(Object data, com.google.common.hash.Hasher h)
public static int djb2int32(byte... bytes)
bytes - bytespublic static int djb2int32(double... bytes)
bytes - bytespublic static int djb2int32(int... bytes)
bytes - bytes@Deprecated public static int djb2int32obj(Serializable... bytes)
hash32(Object...).bytes - bytespublic static long djb2long64(byte... bytes)
bytes - bytespublic static long djb2long64(double... bytes)
bytes - bytespublic static long djb2long64(int... bytes)
bytes - bytes@Deprecated public static long djb2long64obj(Serializable... bytes)
hash64(Object...).bytes - bytespublic static byte[] toByta(double data)
data - doublepublic static byte[] toByta(double[] data)
data - double[]public static byte[] toByta(float data)
data - floatpublic static byte[] toByta(float[] data)
data - float[]public static byte[] toByta(int data)
data - intpublic static byte[] toByta(int[] data)
data - int[]public static byte[] toByta(long data)
data - longpublic static byte[] toByta(long[] data)
data - long[]