chrisvest / xxv

The XXV visual hex viewer for the terminal.
https://chrisvest.github.io/xxv/
85 stars 5 forks source link

Binary diff mode. #12

Open chrisvest opened 5 years ago

chrisvest commented 5 years ago

It's not entirely clear what this means, precisely.

Something already exists for this use case, which may provide inspiration: https://github.com/madsen/vbindiff

Best bet is probably the Myers diff algorithm, or a variant thereof:

The Myers diff can be implemented in linear space, which is quite compelling. There will likely be some up-front computing cost to produce the edit sequence, but once built and indexed, I imagine it'd be possible to inject the necessary edit sequence elements into the rendering of arbitrarily positioned and sized view ports.

And important challenge is that the algorithm might be faced with gigabyte deltas in terabyte files, and it must still finish in "reasonable" time.

Keyboard shortcuts for navigating to next and previous difference would also be helpful.

Finding alignments like in BLAST might also be useful:

chrisvest commented 3 years ago

Speaking of alignment, it's been done already so there's a good opportunity for inspiration or cross-pollination: https://github.com/8051Enthusiast/biodiff