Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.util.MurmurHash Class Reference

List of all members.

Static Public Member Functions

static int hash32 (final byte[] data, int length, int seed)
static int hash32 (final byte[] data, int length)
static int hash32 (final String text) throws UnsupportedEncodingException
static int hash32 (final String text, int from, int length) throws UnsupportedEncodingException
static long hash64 (final byte[] data, int length, int seed)
static long hash64 (final byte[] data, int length)
static long hash64 (final String text) throws UnsupportedEncodingException
static long hash64 (final String text, int from, int length) throws UnsupportedEncodingException

Static Private Attributes

static final String ENCODING = "UTF-16"

Detailed Description

MurmurHash 2.0.

The murmur hash is a relative fast hash function from http://murmurhash.googlepages.com/ for platforms with efficient multiplication.

This is a re-implementation of the original C code plus some additional features.

Public domain.

Author:
Viliam Holub
Version:
1.0.2

Member Function Documentation

static int joshua.util.MurmurHash.hash32 ( final byte[]  data,
int  length,
int  seed 
) [static]

Generates 32 bit hash from byte array of the given length and seed.

Parameters:
databyte array to hash
lengthlength of the array to hash
seedinitial seed value
Returns:
32 bit hash of the given array

Here is the caller graph for this function:

static int joshua.util.MurmurHash.hash32 ( final byte[]  data,
int  length 
) [static]

Generates 32 bit hash from byte array with default seed value.

Parameters:
databyte array to hash
lengthlength of the array to hash
Returns:
32 bit hash of the given array

Here is the call graph for this function:

static int joshua.util.MurmurHash.hash32 ( final String  text) throws UnsupportedEncodingException [static]

Generates 32 bit hash from a string.

Parameters:
textstring to hash
Returns:
32 bit hash of the given string
Exceptions:
UnsupportedEncodingException

Here is the call graph for this function:

static int joshua.util.MurmurHash.hash32 ( final String  text,
int  from,
int  length 
) throws UnsupportedEncodingException [static]

Generates 32 bit hash from a substring.

Parameters:
textstring to hash
fromstarting index
lengthlength of the substring to hash
Returns:
32 bit hash of the given string
Exceptions:
UnsupportedEncodingException

Here is the call graph for this function:

static long joshua.util.MurmurHash.hash64 ( final byte[]  data,
int  length,
int  seed 
) [static]

Generates 64 bit hash from byte array of the given length and seed.

Parameters:
databyte array to hash
lengthlength of the array to hash
seedinitial seed value
Returns:
64 bit hash of the given array

Here is the caller graph for this function:

static long joshua.util.MurmurHash.hash64 ( final byte[]  data,
int  length 
) [static]

Generates 64 bit hash from byte array with default seed value.

Parameters:
databyte array to hash
lengthlength of the array to hash
Returns:
64 bit hash of the given string

Here is the call graph for this function:

static long joshua.util.MurmurHash.hash64 ( final String  text) throws UnsupportedEncodingException [static]

Generates 64 bit hash from a string.

Parameters:
textstring to hash
Returns:
64 bit hash of the given string
Exceptions:
UnsupportedEncodingException

Here is the call graph for this function:

static long joshua.util.MurmurHash.hash64 ( final String  text,
int  from,
int  length 
) throws UnsupportedEncodingException [static]

Generates 64 bit hash from a substring.

Parameters:
textstring to hash
fromstarting index
lengthlength of the substring to hash
Returns:
64 bit hash of the given array
Exceptions:
UnsupportedEncodingException

Here is the call graph for this function:


Member Data Documentation

final String joshua.util.MurmurHash.ENCODING = "UTF-16" [static, private]