it.unimi.dsi.sux4j.mph
Class Hashes

java.lang.Object
  extended by it.unimi.dsi.sux4j.mph.Hashes

public class Hashes
extends java.lang.Object

Basic hash functions.


Method Summary
static long jenkins(BitVector bv)
          Jenkins 64-bit hashing.
static long jenkins(BitVector bv, long seed)
          Jenkins 64-bit hashing.
static void jenkins(BitVector bv, long seed, long[] h)
          Jenkins 64-bit hashing (all three values produced).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

jenkins

public static void jenkins(BitVector bv,
                           long seed,
                           long[] h)
Jenkins 64-bit hashing (all three values produced).

This code is based on the lookup8.c, and in particular on the version consuming 64 bits at a time, but it has been slightly modified to work correctly with any bit vector length (not just multiples of 64). Moreover, we return all three values generated by the algorithm.

Parameters:
bv - a bit vector.
seed - a seed for the hash.
h - a triple of long values in which the three generated hashes will be saved.

jenkins

public static long jenkins(BitVector bv,
                           long seed)
Jenkins 64-bit hashing.

Parameters:
bv - a bit vector.
seed - a seed for the hash.
Returns:
the first of the three hash values returned by jenkins(BitVector, long, long[]).

jenkins

public static long jenkins(BitVector bv)
Jenkins 64-bit hashing.

Parameters:
bv - a bit vector.
Returns:
the first of the three hash values returned by jenkins(BitVector, long, long[]) with seed 0.