Exemplo n.º 1
0
        public void TestFnv1A64HashComputeValue()
        {
            var stringBytes  = Encoding.ASCII.GetBytes("foobar");
            var expectedHash = 0x85944171F73967E8UL;
            var actualHash   = Fnv1A64Hash.ComputeValue(stringBytes);

            Assert.AreEqual(expectedHash, actualHash);
        }
Exemplo n.º 2
0
        public void TestFnv1A64HashComputeHash()
        {
            var helloBytes   = Encoding.ASCII.GetBytes("foobar");
            var expectedHash = new byte[] { 0x85, 0x94, 0x41, 0x71, 0xF7, 0x39, 0x67, 0xE8 };
            var actualHash   = new Fnv1A64Hash().ComputeHash(helloBytes);

            CollectionAssert.AreEqual(expectedHash, actualHash);
        }
Exemplo n.º 3
0
            public ulong Hash(HashableId32 id)
            {
                var idBytes = BitConverter.GetBytes(id.Value);

                return(Fnv1A64Hash.ComputeValue(idBytes));
            }