DELETED www/delta1.gif Index: www/delta1.gif ================================================================== --- www/delta1.gif +++ /dev/null cannot compute difference between binary files DELETED www/delta2.gif Index: www/delta2.gif ================================================================== --- www/delta2.gif +++ /dev/null cannot compute difference between binary files DELETED www/delta3.gif Index: www/delta3.gif ================================================================== --- www/delta3.gif +++ /dev/null cannot compute difference between binary files DELETED www/delta4.gif Index: www/delta4.gif ================================================================== --- www/delta4.gif +++ /dev/null cannot compute difference between binary files DELETED www/delta5.gif Index: www/delta5.gif ================================================================== --- www/delta5.gif +++ /dev/null cannot compute difference between binary files DELETED www/delta6.gif Index: www/delta6.gif ================================================================== --- www/delta6.gif +++ /dev/null cannot compute difference between binary files Index: www/delta_format.wiki ================================================================== --- www/delta_format.wiki +++ www/delta_format.wiki @@ -61,21 +61,30 @@ that returns one row for the header, for the trailer, and for each segment in delta D.

2.0 Structure

- + + leftmargin = 0.1 + box height 50% "Header" + box same "Segments" + box same "Trailer" +

A delta consists of three parts, a "header", a "trailer", and a "segment-list" between them.

Both header and trailer provide information about the target helping the decoder, and the segment-list describes how the target can be constructed from the original.

2.1 Header

- + + leftmargin = 0.1 + box height 50% "Size" + box same "\"\\n\"" +

The header consists of a single number followed by a newline character (ASCII 0x0a). The number is the length of the target in bytes.

@@ -83,11 +92,15 @@ the target (and allocate any necessary memory based on that) by simply reading the first line of the delta and decoding the number found there. In other words, before it has to decode everything else.

2.2 Trailer

- + + leftmargin = 0.1 + box height 50% "Checksum" + box same "\":\"" +

The trailer consists of a single number followed by a semicolon (ASCII 0x3b). This number is a checksum of the target and can be used by a decoder to verify that the delta applied correctly, reconstructing the target from the original.

@@ -100,11 +113,32 @@

By putting this information at the end of the delta a decoder has it available immediately after the target has been reconstructed fully.

2.3 Segment-List

- + + leftmargin = 0.1 + PART1: [ + B1: box height 50% width 15% "" + B2: box same "" + B3: box same "" + move 0.1 ; box same invisible "***" ; move 0.1 + box height 50% width 15% "" + I1: line down 50% from B2 .s + arrow right until even with B3.e + box "Insert Literal" height 50% + line down 75% from I1 .s + arrow right until even with B3.e + box "Copy Range" height 50% + ] + down + box invisible "" height 0.1 + box "Length" height 50% with .nw at (PART1.w, previous.s) + right + box "\":\"" same + box "Bytes" same +

The segment-list of a delta describes how to create the target from the original by a combination of inserting literal byte-sequences and copying ranges of bytes from the original. This is where the compression takes place, by encoding the large common parts of @@ -117,11 +151,17 @@

2.3.1 Insert Literal

A literal is specified by two elements, the size of the literal in bytes, and the bytes of the literal itself.

- + + leftmargin = 0.1 + box "Length" height 50% + box "\":\"" same + box "Bytes" same + +

The length is written first, followed by a colon character (ASCII 0x3a), followed by the bytes of the literal.

2.3.2 Copy Range

@@ -128,11 +168,19 @@

A range to copy is specified by two numbers, the offset of the first byte in the original to copy, and the size of the range, in bytes. The size zero is special, its usage indicates that the range extends to the end of the original.

- + + leftmargin = 0.1 + box "Length" height 50% + box "\"@\"" same + box "Offset" same + box "\",\"" same + + +

The length is written first, followed by an "at" character (ASCII 0x40), then the offset, followed by a comma (ASCII 0x2c).

3.0 Encoding of integers

@@ -181,20 +229,20 @@

This can be taken apart into the following parts:

- - - - - - - - - - + + + + + + + + + +
What Encoding Meaning Details
Header 1Xb Size 6246
S-List 4E@0, Copy 270 @ 0
  2:th Literal 2 'th'
  FN@4C, Copy 983 @ 268
  6:scenda Literal 6 'scenda'
  1B@Jd, Copy 75 @ 1256
  6:scenda Literal 6 'scenda'
  5x@Kt, Copy 380 @ 1336
  6:pieces Literal 6 'pieces'
  79@Qt, Copy 457 @ 1720
Header 1Xb Size 6246
S-List 4E@0, Copy 270 @ 0
  2:th Literal 2 'th'
  FN@4C, Copy 983 @ 268
  6:scenda Literal 6 'scenda'
  1B@Jd, Copy 75 @ 1256
  6:scenda Literal 6 'scenda'
  5x@Kt, Copy 380 @ 1336
  6:pieces Literal 6 'pieces'
  79@Qt, Copy 457 @ 1720
  F: Example: eskilLiteral 15 ' Example: eskil'
  ~E@Y0, Copy 4046 @ 2176
Trailer2zMM3E Checksum -1101438770