Package edu.berkeley.cs.jqf.fuzz.util
Class Hashing
- java.lang.Object
-
- edu.berkeley.cs.jqf.fuzz.util.Hashing
-
public class Hashing extends Object
Utility class for computing bounded hash values.- Author:
- Rohan Padhye
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static inthash(long x, int bound)Returns a bounded hashed value with one input.static inthash1(long x, long y, int bound)Returns a bounded hashed value with two inputs.protected static intknuth(long x, int bound)Compute knuth's multiplicative hash.
-
-
-
Method Detail
-
knuth
protected static int knuth(long x, int bound)Compute knuth's multiplicative hash.Source: Donald Knuth's The Art of Computer Programming, Volume 3 (2nd edition), section 6.4, page 516.
- Parameters:
x- the input value to hashbound- the upper bound- Returns:
- the hash value
-
hash
public static int hash(long x, int bound)Returns a bounded hashed value with one input.- Parameters:
x- the input to hashbound- the upper bound- Returns:
- a pseudo-uniformly distributed value in [0, bound)
-
hash1
public static int hash1(long x, long y, int bound)Returns a bounded hashed value with two inputs.- Parameters:
x- the first input to hashy- the second input to hashbound- the upper bound- Returns:
- a pseudo-uniformly distributed value in [0, bound)
-
-