开发者

Basic file version diff algorithm

开发者 https://www.devze.com 2023-02-21 23:01 出处:网络
I\'m looking for a solution to compare two versions开发者_如何学C of the same file to get a representation of the changes/differences.If it\'s plain text, then Google\'s diff-match-patch library ought

I'm looking for a solution to compare two versions开发者_如何学C of the same file to get a representation of the changes/differences.


If it's plain text, then Google's diff-match-patch library ought to do what you want (it has a C# version).

If it's binary data, then look into the things people do to apply updates to executables (bsdiff and Courgette). They look for the minimum difference between two files so that a smaller update can be sent out to end users. Sounds similar to your needs.


For plain text files, you can find an open source implementation in c# here: https://github.com/mmanela/diffplex

0

精彩评论

暂无评论...
验证码 换一张
取 消