public enum HashAlgorithm extends Enum<HashAlgorithm>
Enum Constant and Description |
---|
CRC32_HASH
CRC32_HASH as used by the perl API.
|
ELECTION_HASH |
ELF_HASH |
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.
|
LUA_HASH
From lua source,it is used for long key
|
MYSQL_HASH
From mysql source
|
NATIVE_HASH
Native hash (String.hashCode()).
|
ONE_AT_A_TIME
The Jenkins One-at-a-time hash ,please see http://www.burtleburtle.net/bob/hash/doobs.html
|
RS_HASH |
Modifier and Type | Method and Description |
---|---|
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.
|
public static final HashAlgorithm NATIVE_HASH
public static final HashAlgorithm CRC32_HASH
public static final HashAlgorithm FNV1_64_HASH
http://www.isthe.com/chongo/tech/comp/fnv/
,
http://en.wikipedia.org/wiki/Fowler_Noll_Vo_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
public static final HashAlgorithm MYSQL_HASH
public static final HashAlgorithm ELF_HASH
public static final HashAlgorithm RS_HASH
public static final HashAlgorithm LUA_HASH
public static final HashAlgorithm ELECTION_HASH
public static final HashAlgorithm ONE_AT_A_TIME
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 nameNullPointerException
- if the argument is nullpublic long hash(String k)
public static byte[] computeMd5(String k)
Copyright © 2021. All rights reserved.