public static HashFunctionResult ComputeMD5Checksum(string path) { var hashFuncResult = new HashFunctionResult() { filePath = path }; hashFuncResult = TryCompute(hashFuncResult); return(hashFuncResult); }
private static HashFunctionResult TryCompute(HashFunctionResult hashFuncResult) { try { hashFuncResult.hashSum = HashFuncMD5(hashFuncResult.filePath); hashFuncResult.error = new HashFunctionException("Без ошибок"); } catch (Exception e) { hashFuncResult.hashSum = String.Empty; hashFuncResult.error = new HashFunctionException("Сообщение ошибки: " + e.Message, e); } return(hashFuncResult); }