Beispiel #1
0
        protected void TestComputeTransforms(IHash a_hash)
        {
            foreach (var creator in m_creators)
            {
                for (int i = 0; i < 10; i++)
                {
                    object v     = creator();
                    byte[] bytes = Converters.ConvertToBytes(v);

                    var h1 = a_hash.ComputeObject(v);
                    var h2 = a_hash.ComputeBytes(bytes);

                    Assert.AreEqual(h1, h2, String.Format("{0}, {1}", a_hash.Name, i));
                }
            }

            {
                var h3 = a_hash.ComputeString("rwffasfger4536552▰Ḑ");
                var h4 = a_hash.ComputeString("rwffasfger4536552▰Ḑ", Encoding.Unicode);

                Assert.AreEqual(h3, h4);
            }
        }
Beispiel #2
0
        protected void TestComputeTransforms(IHash a_hash)
        {
            foreach (var creator in m_creators)
            {
                for (int i = 0; i < 10; i++)
                {
                    object v = creator();
                    byte[] bytes = Converters.ConvertToBytes(v);

                    var h1 = a_hash.ComputeObject(v);
                    var h2 = a_hash.ComputeBytes(bytes);

                    Assert.AreEqual(h1, h2, String.Format("{0}, {1}", a_hash.Name, i));
                }
            }

            {
                var h3 = a_hash.ComputeString("rwffasfger4536552▰Ḑ");
                var h4 = a_hash.ComputeString("rwffasfger4536552▰Ḑ", Encoding.Unicode);

                Assert.AreEqual(h3, h4);
            }
        }