Class MurmurHash2
- Namespace
- Typhon.Schema.Definition
- Assembly
- Typhon.Schema.Definition.dll
MurmurHash2 (32-bit) — a fast non-cryptographic hash used to hash byte/string content, e.g. for value hash codes and index bucketing.
public static class MurmurHash2
- Inheritance
-
MurmurHash2
- Inherited Members
Methods
Hash(byte*, int, uint)
Computes the 32-bit MurmurHash2 of length bytes at dataAddr with the given seed.
public static uint Hash(byte* dataAddr, int length, uint seed)
Parameters
dataAddrbyte*Pointer to the first byte to hash.
lengthintNumber of bytes to hash.
seeduintInitial hash seed.
Returns
- uint
The 32-bit hash, or
0whenlengthis0.
Hash(byte[])
Computes the 32-bit MurmurHash2 of data using the fixed default seed.
public static uint Hash(byte[] data)
Parameters
databyte[]Bytes to hash.
Returns
- uint
The 32-bit hash.
Hash(ReadOnlySpan<byte>)
Computes the 32-bit MurmurHash2 of data using the fixed default seed.
public static uint Hash(ReadOnlySpan<byte> data)
Parameters
dataReadOnlySpan<byte>Bytes to hash.
Returns
- uint
The 32-bit hash.