Class MurmurHash2
This is a very fast, non-cryptographic hash suitable for general hash-based lookup. See http://murmurhash.googlepages.com/ for more details.
The C version of MurmurHash 2.0 found at that site was ported to Java by Andrzej Bialecki (ab at getopt org).
The code from getopt.org was adapted by Mark Harwood in the form here as one of a pluggable choice of
hashing functions as the core function had to be adapted to work with Lucene.Net.Util.BytesRefs with offsets and lengths
rather than raw byte arrays.
This is a Lucene.NET EXPERIMENTAL API, use at your own risk
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Lucene.Net.Codecs.Bloom
Assembly: Lucene.Net.Codecs.dll
Syntax
public sealed class MurmurHash2 : HashFunction
Fields
| Improve this Doc View SourceINSTANCE
Declaration
public static readonly MurmurHash2 INSTANCE
Field Value
Type | Description |
---|---|
MurmurHash2 |
Methods
| Improve this Doc View SourceHash(BytesRef)
Declaration
public override int Hash(BytesRef br)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Util.BytesRef | br |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceHash(Byte[], Int32, Int32, Int32)
Declaration
public static int Hash(byte[] data, int seed, int offset, int len)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | |
System.Int32 | seed | |
System.Int32 | offset | |
System.Int32 | len |
Returns
Type | Description |
---|---|
System.Int32 |
Hash32(Byte[], Int32, Int32)
Generates 32 bit hash from byte array with default seed value.
Declaration
public static int Hash32(byte[] data, int offset, int len)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Byte array to hash. |
System.Int32 | offset | The start position in the array to hash. |
System.Int32 | len | Length of the array elements to hash. |
Returns
Type | Description |
---|---|
System.Int32 | 32 bit hash of the given array. |