public abstract class ClientResolverUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static int[] |
sbox |
| Modifier | Constructor and Description |
|---|---|
protected |
ClientResolverUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
addBytesToHash(byte[] bytes,
int hash)
The below hash generation uses substitution box technique to generate
hashcodes.
|
static int |
addBytesToHash(byte[] bytes,
int offset,
int length,
int hash)
The below hash generation uses substitution box technique to generate
hashcodes.
|
static int |
addByteToHash(byte b,
int hash) |
static int |
addCharsToHash(char[] chars,
int offset,
int length,
int hash) |
static int |
addIntToHash(int val,
int hash) |
static int |
addIntToHashOpt(int val,
int hash) |
static int |
addLongToHash(long val,
int hash) |
static int |
addLongToHashOpt(long val,
int hash) |
static int |
addStringToHash(String s,
int offset,
int length,
int hash) |
static int |
fastHashInt(int v)
Quickly mixes the bits of an integer.
|
static int |
fastHashLong(long v) |
public static final int addBytesToHash(byte[] bytes,
int hash)
sbox array
are from http://home.comcast.net/~bretm/hash/10.html.public static final int addBytesToHash(byte[] bytes,
int offset,
int length,
int hash)
sbox array
are from http://home.comcast.net/~bretm/hash/10.html.public static final int addStringToHash(String s, int offset, int length, int hash)
public static final int addCharsToHash(char[] chars,
int offset,
int length,
int hash)
public static final int addByteToHash(byte b,
int hash)
public static final int addIntToHash(int val,
int hash)
public static final int addLongToHash(long val,
int hash)
public static int addIntToHashOpt(int val,
int hash)
public static int addLongToHashOpt(long val,
int hash)
public static int fastHashInt(int v)
This method mixes the bits of the argument by multiplying by the golden ratio and XORshifting the result. It is borrowed from Koloboke, and it has slightly worse behaviour than MurmurHash3 (in open-addressed hash tables the average number of probes is slightly larger), but it's much faster.
public static int fastHashLong(long v)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.