public static enum HashProvider.HashMethod extends java.lang.Enum<HashProvider.HashMethod>
Enum Constant and Description |
---|
Adler32
Generates hash values using the Adler32 Checksum algorithm.
|
CarterWegman
Generates hash values using the Carter Wegman function (Wikipedia),
which is a universal hashing function.
|
CRC32
Generates hash values using a Cyclic Redundancy Check (CRC32).
|
FNVWithLCG
Uses the Fowler–Noll–Vo (FNV) hash function to generate a hash values.
|
MD2
Generates a hash value using MD2.
|
MD5
Generates a hash value using the cryptographic MD5 hash function.
|
Murmur2
Generates hash values using the Murmur 2 hash, see: https://code.google.com/p/smhasher/wiki/MurmurHash2
Murmur 2 is very fast.
|
Murmur3
Generates hash values using the Murmur 3 hash, see: https://code.google.com/p/smhasher/wiki/MurmurHash3
Its uniformity is comparable to that of cryptographic hash functions but considerably faster.
|
Murmur3KirschMitzenmacher
Uses a the Murmur 3 hash in combination with a performance optimization described by Kirsch and Mitzenmacher,
see: http://www.eecs.harvard.edu/~kirsch/pubs/bbbf/esa06.pdf - hash values are generated through the scheme
h_i = (h1 + i*h2) mod m Though this method is asymptotically optimal our experiements revealed that
real-world performance is not as good as pure Murmur 3 hashes or cryptographic hash functions, in particular
for random words.
|
RNG
Generates hash values using the Java Random Number Generator (RNG) which is a Linear Congruential Generator
(LCG), implementing the following formula:
number_i+1 = (a * number_i + countingBits) mod
size The RNG is initialized using the value to be hashed. |
SHA1
Generates a hash value using the cryptographic SHA1 hash function.
|
SHA256
Generates a hash value using the cryptographic SHA-256 hash function.
|
SHA384
Generates a hash value using the cryptographic SHA-384 hash function.
|
SHA512
Generates a hash value using the cryptographic SHA-512 hash function.
|
Modifier and Type | Method and Description |
---|---|
HashProvider.HashFunction |
getHashFunction() |
static HashProvider.HashMethod |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static HashProvider.HashMethod[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final HashProvider.HashMethod RNG
number_i+1 = (a * number_i + countingBits) mod
size
public static final HashProvider.HashMethod CarterWegman
public static final HashProvider.HashMethod CRC32
public static final HashProvider.HashMethod Adler32
public static final HashProvider.HashMethod Murmur2
Murmur 2 is very fast. However, there is a flaw that affects the uniformity of some input values (for instance increasing integers as strings).
public static final HashProvider.HashMethod Murmur3
Its uniformity is comparable to that of cryptographic hash functions but considerably faster.
public static final HashProvider.HashMethod Murmur3KirschMitzenmacher
Though this method is asymptotically optimal our experiements revealed that real-world performance is not as good as pure Murmur 3 hashes or cryptographic hash functions, in particular for random words.
public static final HashProvider.HashMethod FNVWithLCG
Arrays
and can be easily implemented in most languages. Hashing then uses the very
simple Linear Congruential Generator scheme and the Java initialization constants. This method is intended to
be employed if the bloom filter has to be used in a language which doesn't support any of the other hash
functions. This hash function can then easily be implemented.public static final HashProvider.HashMethod MD2
public static final HashProvider.HashMethod MD5
public static final HashProvider.HashMethod SHA1
public static final HashProvider.HashMethod SHA256
public static final HashProvider.HashMethod SHA384
public static final HashProvider.HashMethod SHA512
public static HashProvider.HashMethod[] values()
for (HashProvider.HashMethod c : HashProvider.HashMethod.values()) System.out.println(c);
public static HashProvider.HashMethod valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic HashProvider.HashFunction getHashFunction()