类 MurmurHash
java.lang.Object
net.apexes.commons.lang.MurmurHash
Murmur hash 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.
- 版本:
- 1.0.2
- 作者:
- Viliam Holub
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static inthash32(byte[] data, int length) Generates 32 bit hash from byte array with default seed value.static inthash32(byte[] data, int length, int seed) Generates 32 bit hash from byte array of the given length and seed.static intGenerates 32 bit hash from a string.static intGenerates 32 bit hash from a substring.static longhash64(byte[] data, int length) Generates 64 bit hash from byte array with default seed value.static longhash64(byte[] data, int length, int seed) Generates 64 bit hash from byte array of the given length and seed.static longGenerates 64 bit hash from a string.static longGenerates 64 bit hash from a substring.
-
构造器详细资料
-
MurmurHash
public MurmurHash()
-
-
方法详细资料
-
hash32
public static int hash32(byte[] data, int length, int seed) Generates 32 bit hash from byte array of the given length and seed.- 参数:
data- byte array to hashlength- length of the array to hashseed- initial seed value- 返回:
- 32 bit hash of the given array
-
hash32
public static int hash32(byte[] data, int length) Generates 32 bit hash from byte array with default seed value.- 参数:
data- byte array to hashlength- length of the array to hash- 返回:
- 32 bit hash of the given array
-
hash32
Generates 32 bit hash from a string.- 参数:
text- string to hash- 返回:
- 32 bit hash of the given string
-
hash32
Generates 32 bit hash from a substring.- 参数:
text- string to hashfrom- starting indexlength- length of the substring to hash- 返回:
- 32 bit hash of the given string
-
hash64
public static long hash64(byte[] data, int length, int seed) Generates 64 bit hash from byte array of the given length and seed.- 参数:
data- byte array to hashlength- length of the array to hashseed- initial seed value- 返回:
- 64 bit hash of the given array
-
hash64
public static long hash64(byte[] data, int length) Generates 64 bit hash from byte array with default seed value.- 参数:
data- byte array to hashlength- length of the array to hash- 返回:
- 64 bit hash of the given string
-
hash64
Generates 64 bit hash from a string.- 参数:
text- string to hash- 返回:
- 64 bit hash of the given string
-
hash64
Generates 64 bit hash from a substring.- 参数:
text- string to hashfrom- starting indexlength- length of the substring to hash- 返回:
- 64 bit hash of the given array
-