|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<HashAlgorithm> net.spy.memcached.HashAlgorithm
public enum HashAlgorithm
Known hashing algorithms for locating a server for a key. Note that all hash algorithms return 64-bits of hash, but only the lower 32-bits are significant. This allows a positive 32-bit number to be returned for all cases.
Enum Constant Summary | |
---|---|
CRC32_HASH
CRC32_HASH as used by the perl API. |
|
FNV1_32_HASH
32-bit FNV1. |
|
FNV1_64_HASH
FNV hashes are designed to be fast while maintaining a low collision rate. |
|
FNV1A_32_HASH
32-bit FNV1a. |
|
FNV1A_64_HASH
Variation of FNV. |
|
KETAMA_HASH
MD5-based hash algorithm used by ketama. |
|
NATIVE_HASH
Native hash (String.hashCode()). |
Method Summary | |
---|---|
static byte[] |
computeMd5(String k)
Get the md5 of the given key. |
long |
hash(String k)
Compute the hash for the given key. |
static HashAlgorithm |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static HashAlgorithm[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final HashAlgorithm NATIVE_HASH
public static final HashAlgorithm CRC32_HASH
public static final HashAlgorithm FNV1_64_HASH
public static final HashAlgorithm FNV1A_64_HASH
public static final HashAlgorithm FNV1_32_HASH
public static final HashAlgorithm FNV1A_32_HASH
public static final HashAlgorithm KETAMA_HASH
Method Detail |
---|
public static HashAlgorithm[] values()
for (HashAlgorithm c : HashAlgorithm.values()) System.out.println(c);
public static HashAlgorithm valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic long hash(String k)
public static byte[] computeMd5(String k)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |