Exemplo n.º 1
0
        public void testHashCodeM3_64()
        {
            byte[] origin = Encoding.UTF8.GetBytes(
                "It was the best of times, it was the worst of times," +
                " it was the age of wisdom, it was the age of foolishness," +
                " it was the epoch of belief, it was the epoch of incredulity," +
                " it was the season of Light, it was the season of Darkness," +
                " it was the spring of hope, it was the winter of despair," +
                " we had everything before us, we had nothing before us," +
                " we were all going direct to Heaven," +
                " we were all going direct the other way.");
            long hash = Murmur3.hash64(origin, 0, origin.Length);

            Assert.Equal(305830725663368540L, hash);

            byte[] originOffset = new byte[origin.Length + 150];
            Arrays.fill(originOffset, (byte)123);
            Array.Copy(origin, 0, originOffset, 150, origin.Length);
            hash = Murmur3.hash64(originOffset, 150, origin.Length);
            Assert.Equal(305830725663368540L, hash);
        }