org.getopt.util.hash
Class FNV132

java.lang.Object
  extended by org.getopt.util.hash.FNV1
      extended by org.getopt.util.hash.FNV132

public class FNV132
extends FNV1

Implementation of FNV1 - a fast hash function.

This implementation uses 32-bit operations, and the values returned from getHash() are limited to the lower 32 bits.

Author:
Andrzej Bialecki <ab@getopt.org>

Field Summary
 
Fields inherited from class org.getopt.util.hash.FNV1
FNV1_32_INIT, FNV1_64_INIT, hash, INIT
 
Constructor Summary
FNV132()
          Create a hash
 
Method Summary
protected  long fnv(byte[] buf, int offset, int len, long seed)
          Compute the hash value.
 long getHash()
          Retrieve the hash value
 
Methods inherited from class org.getopt.util.hash.FNV1
init, init, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FNV132

public FNV132()
Create a hash

Method Detail

getHash

public long getHash()
Description copied from class: FNV1
Retrieve the hash value

Overrides:
getHash in class FNV1
Returns:
hash value

fnv

protected long fnv(byte[] buf,
                   int offset,
                   int len,
                   long seed)
Description copied from class: FNV1
Compute the hash value.

Specified by:
fnv in class FNV1
Parameters:
buf - byte buffer from which to compute the hash
offset - starting position in the buffer
len - number of bytes after the starting position
seed - initial seed (or previous hash value)
Returns:
the next hash value