Class FNV1a64

  extended by org.getopt.util.hash.FNV1
      extended by org.getopt.util.hash.FNV1a64

public class FNV1a64
extends FNV1

Implementation of FNV1a - a fast hash function. The FNV1a variant provides a slightly better dispersion for short (< 4 bytes) values than plain FNV1.

This implementation uses 64-bit operations.

Andrzej Bialecki <>

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

Constructor Detail


public FNV1a64()
Create a hash

Method Detail


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
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)
the next hash value