VAGSuite.TransactionLog.VerifyChecksum C# (CSharp) Метод

VerifyChecksum() публичный Метод

public VerifyChecksum ( ) : bool
Результат bool
        public bool VerifyChecksum()
        {
            bool retval = false;
            // checksum should be in the file as well, ranging from byte 4 - end
            FileInfo fi = new FileInfo(m_fileName);
            Int32 checksum = readInt32FromFile(m_fileName, 0);
            byte[] fileContent = readbytesFromFile(m_fileName, 4, (int)(fi.Length - 4));
            Int32 calcChecksum = 0;
            foreach (byte b in fileContent)
            {
                calcChecksum += Convert.ToInt32(b);
            }
            if (calcChecksum == checksum) retval = true;
            return retval;
        }