Exemplo n.º 1
0
        public void Murmur3aTest()
        {
            Murmur3a target = new Murmur3a();

            byte[] buffer   = ASCIIEncoding.ASCII.GetBytes("ThisIsATestValueForMurmurHash3");
            byte[] expected = StaticTestUtilities.GetStringToBytes("bbcac44bfcae82a84a46adad35cecf90");  // http://murmurhash.shorelabs.com/  but you need to use the x64/128 bit implementation, AND do a BigEndian on it.
            byte[] actual;
            actual = target.ComputeHash(buffer);
            Assert.AreEqual(expected.Length, actual.Length);
            for (int i = 0; i < expected.Length; i++)
            {
                Assert.AreEqual(expected[i], actual[i]);
            }
        }