Ejemplo n.º 1
0
        public void FileCRCTest()
        {
            const string path   = @"..\..\[CRC Sample]\VIDEO_TS [57FD7F1E].IFO";
            var          calCRC = Crc32.NET.Crc32Algorithm.FileCRC(path).Result;

            CRC32.FindCRC(path, out var fileCRC);
            Console.WriteLine($@"{fileCRC} {calCRC}");
            Assert.IsTrue(calCRC == fileCRC);
        }
Ejemplo n.º 2
0
        public void FileCRCTest()
        {
            const string path = @"..\..\..\[CRC Sample]\VIDEO_TS [57FD7F1E].IFO";
            var          hash = new Crc32Algorithm();

            using (var file = File.OpenRead(path))
            {
                var crcByte = hash.ComputeHash(file);
                var calCRC  = (uint)crcByte[0] << 24 | (uint)crcByte[1] << 16 | (uint)crcByte[2] << 8 | crcByte[3];
                CRC32.FindCRC(path, out var fileCRC);
                Console.WriteLine($@"{fileCRC} {calCRC}");
                Assert.IsTrue(calCRC == fileCRC);
            }
        }