Exemplo n.º 1
0
 public static void AddPositionToHash(BHasher hasher, OMV.Vector3 pos, OMV.Quaternion rot)
 {
     hasher.Add(pos.X);
     hasher.Add(pos.Y);
     hasher.Add(pos.Z);
     hasher.Add(rot.X);
     hasher.Add(rot.Y);
     hasher.Add(rot.Z);
     hasher.Add(rot.W);
 }
Exemplo n.º 2
0
        private void TestHasher(string name, BHasher hasher1, BHasher hasher2, byte[] testBytes)
        {
            hasher1.Add(testBytes, 0, testBytes.Length);
            BHash hash1 = hasher1.Finish();

            hasher2.Add(testBytes[0]);
            hasher2.Add(testBytes, 1, 10);
            hasher2.Add(testBytes[11]);
            hasher2.Add(testBytes, 12, testBytes.Length - 12);
            BHash hash2 = hasher2.Finish();

            Assert.AreEqual(hash1.ToString(), hash2.ToString(), "Adding bytes in different order gave different results in " + name);
        }