public static int FNVhash32(int val){
  int hashval=FNV_offset_basis_32;
  for (int i=0; i < 4; i++) {
    int octet=val & 0x00ff;
    val=val >> 8;
    hashval=hashval ^ octet;
    hashval=hashval * FNV_prime_32;
  }
  return Math.abs(hashval);
}

public static int FNVhash32 ( int val ) { int hashval = FNV_offset_basis_32 ; for ( int i = 0 ; i < 4 ; i ++ ) { int octet = val & 0x00ff ; val = val > > 8 ; hashval = hashval ^ octet ; hashval = hashval * FNV_prime_32 ; } return Math . abs ( hashval ) ; }
32 bit fnv hash . produces more " random " hashes than ( say ) string . hashcode ( ) .
