public static class MinimalPerfectHash.StringHash extends java.lang.Object implements MinimalPerfectHash.UniversalHash<java.lang.String>
| Constructor and Description |
|---|
StringHash() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getFastHash(java.lang.String o,
int index,
int seed)
A cryptographically weak hash function.
|
static int |
getSipHash24(byte[] b,
int start,
int end,
long k0,
long k1)
A cryptographically relatively secure hash function.
|
static int |
getSipHash24(java.lang.String o,
long k0,
long k1)
A cryptographically relatively secure hash function.
|
int |
hashCode(java.lang.String o,
int index,
int seed)
Calculate the hash of the given object.
|
public int hashCode(java.lang.String o,
int index,
int seed)
MinimalPerfectHash.UniversalHashhashCode in interface MinimalPerfectHash.UniversalHash<java.lang.String>o - the objectindex - the hash function index (index 0 is used first, so the
method should be very fast with index 0; index 1 and so on
are only called when really needed)seed - the random seed (always the same for a hash table)public static int getFastHash(java.lang.String o,
int index,
int seed)
o - the stringindex - the hash function indexseed - the seedpublic static int getSipHash24(java.lang.String o,
long k0,
long k1)
o - the stringk0 - key 0k1 - key 1public static int getSipHash24(byte[] b,
int start,
int end,
long k0,
long k1)
b - the datastart - the start positionend - the end position plus onek0 - key 0k1 - key 1