Class MurmurHash
Murmur3 Hash implementation
Inherited Members
Namespace: Akka.Util
Assembly: Akka.dll
Syntax
public static class MurmurHash
Fields
| Improve this Doc View SourceStartMagicA
The initial magic integer in the first stream.
Declaration
public const uint StartMagicA = 2505324423U
Field Value
Type | Description |
---|---|
UInt32 |
StartMagicB
The initial magic integer in the second stream.
Declaration
public const uint StartMagicB = 718793509U
Field Value
Type | Description |
---|---|
UInt32 |
Methods
| Improve this Doc View SourceArrayHash<T>(T[])
Compute a high-quality hash of an array
Declaration
public static int ArrayHash<T>(T[] a)
Parameters
Type | Name | Description |
---|---|---|
T[] | a | TBD |
Returns
Type | Description |
---|---|
Int32 | TBD |
Type Parameters
Name | Description |
---|---|
T |
ByteHash(Byte[])
Compute a high-quality hash of a byte array
Declaration
public static int ByteHash(byte[] b)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | b | TBD |
Returns
Type | Description |
---|---|
Int32 | TBD |
ExtendHash(UInt32, UInt32, UInt32, UInt32)
Incorporates a new value into an existing hash
Declaration
public static uint ExtendHash(uint hash, uint value, uint magicA, uint magicB)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | hash | The prior hash value |
UInt32 | value | The new value to incorporate |
UInt32 | magicA | A magic integer from the left of the stream |
UInt32 | magicB | A magic integer from a different stream |
Returns
Type | Description |
---|---|
UInt32 | The updated hash value |
FinalizeHash(UInt32)
Once all hashes have been incorporated, this performs a final mixing.
Declaration
public static uint FinalizeHash(uint hash)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | hash | TBD |
Returns
Type | Description |
---|---|
UInt32 | TBD |
NextMagicA(UInt32)
Given a magic integer from the first stream, compute the next
Declaration
public static uint NextMagicA(uint magicA)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | magicA | TBD |
Returns
Type | Description |
---|---|
UInt32 | TBD |
NextMagicB(UInt32)
Given a magic integer from the second stream, compute the next
Declaration
public static uint NextMagicB(uint magicB)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | magicB | TBD |
Returns
Type | Description |
---|---|
UInt32 | TBD |
StartHash(UInt32)
Begin a new hash with a seed value.
Declaration
public static uint StartHash(uint seed)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | seed | TBD |
Returns
Type | Description |
---|---|
UInt32 | TBD |
StringHash(String)
Compute high-quality hash of a string
Declaration
public static int StringHash(string s)
Parameters
Type | Name | Description |
---|---|---|
String | s | TBD |
Returns
Type | Description |
---|---|
Int32 | TBD |
SymmetricHash<T>(IEnumerable<T>, UInt32)
Compute a hash that is symmetric in its arguments--that is, where the order of appearance of elements does not matter. This is useful for hashing sets, for example.
Declaration
public static int SymmetricHash<T>(IEnumerable<T> xs, uint seed)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | xs | TBD |
UInt32 | seed | TBD |
Returns
Type | Description |
---|---|
Int32 | TBD |
Type Parameters
Name | Description |
---|---|
T |