Exemple #1
0
        public void TestVectorsUnsafe()
        {
            for (int i = 1; i < 2048; ++i)
            {
                string testData = new string('a', i);
                byte[] data     = Encoding.ASCII.GetBytes(testData);

                unsafe
                {
                    fixed(byte *ptr = data)
                    {
                        ulong value = FarshHash64Unsafe.ComputeHash(ptr, data.Length);

                        Assert.Equal(_vectors[i - 1], value);
                    }
                }
            }
        }
 public unsafe ulong FarshHash64UnsafeTest()
 {
     return(FarshHash64Unsafe.ComputeHash(_unsafePtr, _testData.Length));
 }