File: doc.go

package info (click to toggle)
golang-github-kr-binarydist 0.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 140 kB
  • sloc: makefile: 13
file content (24 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Package binarydist implements binary diff and patch as described on
// http://www.daemonology.net/bsdiff/. It reads and writes files
// compatible with the tools there.
package binarydist

var magic = [8]byte{'B', 'S', 'D', 'I', 'F', 'F', '4', '0'}

// File format:
//   0       8    "BSDIFF40"
//   8       8    X
//   16      8    Y
//   24      8    sizeof(newfile)
//   32      X    bzip2(control block)
//   32+X    Y    bzip2(diff block)
//   32+X+Y  ???  bzip2(extra block)
// with control block a set of triples (x,y,z) meaning "add x bytes
// from oldfile to x bytes from the diff block; copy y bytes from the
// extra block; seek forwards in oldfile by z bytes".
type header struct {
	Magic   [8]byte
	CtrlLen int64
	DiffLen int64
	NewSize int64
}