ndiff 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ndiff --version 1.2.0                
NuGet\Install-Package ndiff -Version 1.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ndiff" Version="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ndiff --version 1.2.0                
#r "nuget: ndiff, 1.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ndiff as a Cake Addin
#addin nuget:?package=ndiff&version=1.2.0

// Install ndiff as a Cake Tool
#tool nuget:?package=ndiff&version=1.2.0                

NDiff

A sequence comparison library for any object.

Description

A C# implementation of the Longest Common Subsequence algorithm for both text and objects.

The code is adapted from the original code at Mathertel.

The original code provided an algorithm implementation for strings. NDiff extends this to handle all types. If the type being compared does not implement IEquatable<T>, then an IEqualityComparer<T> should be provided.

Runtime Environment

The project is built against under .NET Standard 2.0, 2.1 and .NET 5.0.

Using the Library

Comparison operations are implemented as extension methods on either strings or enumerables (IEnumerable<T>). Calling the Diff extension method will produce a set of DiffEntry objects describing all differences between the compared sequences.

Using the Format extension method will provide a list of Compared<T>. This list gives all items in the source list and other list and marks them with the ChangeAction for that item. This lets you generate a list of deletions and insertions for any item type.

Similar formatting options are provided for strings, using the DiffFormat extension methods.

For the moment, please refer to the tests for usage examples. There are tests for both text and object sequences.

Reporting Issues and Bugs

When reporting issues and bugs, please provide a clear set of steps to reproduce the issue. The best way is to provide a failing test case as a pull request.

If that is not possible, please provide a set of steps which allow the bug to be reliably reproduced. These steps must also reproduce the issue on a computer that is not your own.

Contributions

All contributions are appreciated. Please provide them as an issue with an accompanying pull request.

This is an open source project. Work has gone into the project it was forked from, as well as the later improvements. Please respect the license terms and the fact that issues and contributions may not be handled as fast as you may wish. The best way to get your contribution adopted is to make it easy to pull into the code base.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.0 192 6/26/2023
1.4.0 407 11/11/2022
1.3.0 318 12/28/2021
1.2.0 414 2/14/2021
1.0.1 538 10/24/2020
1.0.0 613 4/28/2019