private static string CalculateHash(FileInfo sourceFile) { if (_md5 == null) _md5 = MD5.Create(); using (var src = new ProgressStream(sourceFile.OpenRead())) { var hashBytes = _md5.ComputeHash(src); if (exit_loops) return string.Empty; var res = BitConverter.ToString(hashBytes).Replace("-", "").ToLower(); return res; } }
private static string CalculateHash(FileInfo sourceFile) { if (_md5 == null) { _md5 = MD5.Create(); } using (var src = new ProgressStream(sourceFile.OpenRead())) { var hashBytes = _md5.ComputeHash(src); if (exit_loops) { return(string.Empty); } var res = BitConverter.ToString(hashBytes).Replace("-", "").ToLower(); return(res); } }