public final class HashMixer extends Object
This implementation is based on C code placed in the public domain by Bob Jenkins. It is advertised as strong enough to allow the
use of hash & mask
instead of hash % prime
for computing a hash bucket.
Constructor and Description |
---|
HashMixer()
Constructs a mixer by initializing the internal state.
|
Modifier and Type | Method and Description |
---|---|
int |
finalMix(int i,
int j,
int k)
Performs the final "mix" of the internal state with the given parameters, resets the state, and returns the
resulting hash code.
|
void |
mix(int i,
int j,
int k)
Replicates the computation of Bob Jenkins' "mix" macro.
|
public HashMixer()
public void mix(int i, int j, int k)
i
- the first input to the macroj
- the second input to the macrok
- the third input to the macropublic int finalMix(int i, int j, int k)
i
- the first four bytes to includej
- the second four bytes to includek
- the final four bytes to includemix(int, int, int)
,
and parameters to finalMix(int, int, int)
Copyright © 2024 Actian Corporation. All rights reserved.