public static string CalcChecksum(string instrFile) { ulong num1 = 0; uint num2 = 256; Tools.ReplaceChecksum(ref instrFile, "0000000000"); byte[] bytes = Encoding.GetEncoding(1252).GetBytes(instrFile); int index = 0; while (index <= instrFile.Length - 1) { byte num3 = bytes[index]; byte num4; byte num5; byte num6; if (index + 1 < instrFile.Length) { num4 = bytes[index + 1]; if (index + 2 < instrFile.Length) { num5 = bytes[index + 2]; num6 = index + 3 >= instrFile.Length ? (byte) 0 : bytes[index + 3]; } else { num5 = (byte) 0; num6 = (byte) 0; } } else { num4 = (byte) 0; num5 = (byte) 0; num6 = (byte) 0; } ulong num7 = (ulong) (num2 * (num2 * (num2 * (uint) num3 + (uint) num4) + (uint) num5) + (uint) num6); num1 += num7; if (num1 > 4294967296UL) num1 -= 4294967296UL; index += 4; } return num1.ToString("0000000000"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)