jaulib v1.3.0
Jau Support Library (C++, Java, ..)
Static Public Member Functions | List of all members
org.jau.util.Hash32 Class Reference
Collaboration diagram for org.jau.util.Hash32:

Static Public Member Functions

static int hash (final int prime, final byte a[])
 
static int hash (final int prime, final int a, final int b)
 
static int hash31 (final int a, final int b)
 Generates a 32bit equally distributed hash value using prime 31. More...
 
static int hash31 (final long addr)
 Generates a 32bit equally distributed identity hash value from addr avoiding XOR collision using prime 31. More...
 
static int hash31 (final long addr, final long size)
 Generates a 32bit equally distributed identity hash value from addr and size avoiding XOR collision using prime 31. More...
 

Detailed Description

Definition at line 26 of file Hash32.java.

Member Function Documentation

◆ hash() [1/2]

static int org.jau.util.Hash32.hash ( final int  prime,
final byte  a[] 
)
static
  • 31 - the traditional 'Java' prime for 31 * x == (x << 5) - x
  • 92821 - result of Hans-Peter Stoerr's finding
Parameters
prime
a
Returns

Definition at line 37 of file Hash32.java.

Here is the caller graph for this function:

◆ hash() [2/2]

static int org.jau.util.Hash32.hash ( final int  prime,
final int  a,
final int  b 
)
static

Definition at line 48 of file Hash32.java.

◆ hash31() [1/3]

static int org.jau.util.Hash32.hash31 ( final int  a,
final int  b 
)
static

Generates a 32bit equally distributed hash value using prime 31.

Definition at line 56 of file Hash32.java.

Here is the call graph for this function:

◆ hash31() [2/3]

static int org.jau.util.Hash32.hash31 ( final long  addr)
static

Generates a 32bit equally distributed identity hash value from addr avoiding XOR collision using prime 31.

Definition at line 66 of file Hash32.java.

Here is the call graph for this function:

◆ hash31() [3/3]

static int org.jau.util.Hash32.hash31 ( final long  addr,
final long  size 
)
static

Generates a 32bit equally distributed identity hash value from addr and size avoiding XOR collision using prime 31.

Definition at line 77 of file Hash32.java.

Here is the call graph for this function:

The documentation for this class was generated from the following file: