예제 #1
0
        public void TestMethod1()
        {
            MurMurHash3 mm3 = new MurMurHash3();

            for (int i = 0; i < byteStream.Count; i++)
            {
                sbyte[] s = byteStream[i].ToArray();
                if (i == 15)
                {
                    System.Diagnostics.Trace.WriteLine("stop");
                }
                long res  = mm3.MurmurHash3_x64_64(s, (uint)s.Length, 9001);
                long res2 = (long)((ulong)res >> 32);
                System.Diagnostics.Trace.WriteLine(i + " Computed " + mm3.MurmurHash3_x64_64(s, (uint)s.Length, 9001).ToString("x")
                                                   + " expected " + byteStreamMurMur3Hashes[i].ToString("x"));
                Assert.AreEqual((long)((ulong)res >> 32), byteStreamMurMur3Hashes[i]);
            }
        }
예제 #2
0
        public void TestMethod2()
        {
            MurMurHash3 mm3 = new MurMurHash3();

            for (int i = 0; i < integers.Count; i++)
            {
                int res  = (int)((ulong)mm3.MurmurHash3_x64_64((int)integers[i]) >> 32);
                int comp = (int)intMurmur3Hashes[i];
                Assert.AreEqual(res, comp);
            }
        }