One approach is to find the longest common subsequence between two files, then regard the non-common data as an insertion, or a deletion.
[4] The rsync protocol uses a rolling hash function to compare two files on two distant computers with low communication overhead.
The optimal way to display the results of a file comparison depends on many factors, including the type of source data.
This does not work with documents, where adding a single word may cause the following lines to wrap differently, but still not change the content.
The most popular ways to display changes are either side-by-side, or a consolidating view that highlights data inserts, and deletes.
In 1957, John Van Gardner developed a system to compare the check sums of loaded sections of Fortran programs to debug compilation problems on the IBM 704.