Exemple #1
0
        public void CalculateCRC32Test2()
        {
            const string testData = "Hello, World!";

            UInt32 checksum = 0;

            for (UInt32 i = 0; i < testData.Length; i++)
            {
                checksum = CRC32.CalculateCRC32(checksum, Convert.ToByte(testData[checked ((int)i)]));
            }

            Assert.AreEqual(0x4D551068u, checksum);
        }
Exemple #2
0
        public void CalculateCRC32Test()
        {
            const string testData = "123456789";

            UInt32 checksum = 0;

            for (UInt32 i = 0; i < testData.Length; i++)
            {
                checksum = CRC32.CalculateCRC32(checksum, Convert.ToByte(testData[checked ((int)i)]));
            }

            Assert.AreEqual(0xE3069283, checksum);
        }