sw-delta
sw-delta copied to clipboard
Format needs documentation
Hello!
This project is a really interesting idea! I'm trying to write server-side implementations in C# (ASP.NET Core) and PHP, but am having trouble working out the exact format of the delta.
As shown in deltaCalculator.js, going from "this is some test. blah blah blah" to "this is other text. blah blah blah" results in this delta:
§8-1§2-1§1+th§3+r§4-1§1+x
In the 1+th segment, what does the "1" represent? Does it mean that the addition is offset from the previous removal by one character? Is the offset from the start of the previous substring, or the end? It would be good to write a simple spec for other people wanting to implement the same protocol.
Thanks!
Hi @Daniel15. As the format is probably going to change to binary soon (#7), do not spend too much time writing these implementations now.
I'll answer to the format question when I get a little more time!
You made me realize that the number of added/removed chars was included in the next offset, which was useless.
Have a look at https://github.com/gmetais/sw-delta-nodejs/pull/1. I believe it's easier to understand now, can you tell me if it still requires a documentation?
I'll try to take a look soon. I think it's still worth documenting the format for clarity :)