c#版:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace gjh.utility
{
public class MurmurHash64B
{
public static ulong MakeHashValue(byte[] key, uint seed = 0xee6b27eb)
{
uint len = (uint)key.Length;
const uint m = 0x5bd1e995;
const int r = 24;
uint h1 = seed ^ len;
uint h2 = 0;
int pos = 0;
while (len >= 8)
{
uint k1 = System.BitConverter.ToUInt32(key, pos);
pos += 4;
k1 *= m; k1 ^= k1 >> r; k1 *= m;
h1 *= m; h1 ^= k1;
len -= 4;
uint k2 = System.BitConverter.ToUInt32(key, pos);
pos += 4;
k2 *= m; k2 ^= k2 >> r; k2 *= m;