public class HashProvider
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
HashProvider.HashFunction
An interface which can be implemented to provide custom hash functions.
|
static class |
HashProvider.HashMethod
Different types of hash functions that can be used.
|
Constructor and Description |
---|
HashProvider() |
Modifier and Type | Method and Description |
---|---|
static int[] |
hashAdler(byte[] value,
int m,
int k) |
static int[] |
hashCarterWegman(byte[] value,
int m,
int k) |
static int[] |
hashCassandra(byte[] value,
int m,
int k) |
static int[] |
hashChecksum(byte[] value,
java.util.zip.Checksum cs,
int m,
int k) |
static int[] |
hashCRC(byte[] value,
int m,
int k) |
static int[] |
hashCrypt(byte[] value,
int m,
int k,
java.lang.String method) |
static int[] |
hashMurmur2(byte[] value,
int em,
int ka) |
static int[] |
hashMurmur3(byte[] value,
int m,
int k) |
static int[] |
hashRNG(byte[] value,
int m,
int k) |
static int[] |
hashSimpleLCG(byte[] value,
int m,
int k) |
static int |
murmur3(int seed,
byte[] bytes) |
static int[] |
rejectionSample(java.util.function.BiFunction<java.lang.Integer,byte[],java.lang.Integer> hashFunction,
byte[] value,
int m,
int k) |
static int |
rejectionSample(int random,
int m)
Performs rejection sampling on a random 32bit Java int (sampled from Integer.MIN_VALUE to Integer.MAX_VALUE).
|
public static int[] hashCarterWegman(byte[] value, int m, int k)
value
- the value to be hashedm
- integer output range [1,size]k
- number of hashes to be computedpublic static int[] hashRNG(byte[] value, int m, int k)
value
- the value to be hashedm
- integer output range [1,size]k
- number of hashes to be computedpublic static int[] hashCRC(byte[] value, int m, int k)
value
- the value to be hashedm
- integer output range [1,size]k
- number of hashes to be computedpublic static int[] hashAdler(byte[] value, int m, int k)
value
- the value to be hashedm
- integer output range [1,size]k
- number of hashes to be computedpublic static int[] hashChecksum(byte[] value, java.util.zip.Checksum cs, int m, int k)
public static int[] hashSimpleLCG(byte[] value, int m, int k)
value
- the value to be hashedm
- integer output range [1,size]k
- number of hashes to be computedpublic static int[] hashMurmur3(byte[] value, int m, int k)
public static int[] hashCassandra(byte[] value, int m, int k)
public static int murmur3(int seed, byte[] bytes)
public static int[] hashMurmur2(byte[] value, int em, int ka)
public static int rejectionSample(int random, int m)
random
- intm
- integer output range [1,size]public static int[] rejectionSample(java.util.function.BiFunction<java.lang.Integer,byte[],java.lang.Integer> hashFunction, byte[] value, int m, int k)
public static int[] hashCrypt(byte[] value, int m, int k, java.lang.String method)
value
- the value to be hashedm
- integer output range [1,size]k
- number of hashes to be computedmethod
- the hash method name used by MessageDigest.getInstance(String)