Reversible string diff (history) algorithms for C#?
Here's an interesting question that I don't know much about in terms of existing solutions or research in the field, though I would imagine it relates to the field of compression.
Given two potentially large strings of text, where one represents a later version of the former, is it possible (well I know it's possible, I'm asking really are there existing solutions) to compare those two strings and reduce 开发者_如何学Cthem to a set of differences that could then later be used to deterministically reconstruct the original strings?
In my case, I'm interested in storing the latest version of the string, but keeping "compressed" (diffed) historical backups that can be restored as needed, without actually having to store all of the duplicated information.
I don't know what to tag this, please help me out.
There is no built in classes in CLR that support diffing.
Related questions seem to have have useful information (i.e. Creating Delta Diff Patches of large Binary Files in C#). You can also look search on "Delta encoding" to start with (i.e. http://en.wikipedia.org/wiki/Delta_encoding).
精彩评论