delta

package
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: AGPL-3.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package delta provides binary diff generation and application for package files. It wraps the bsdiff algorithm (github.com/totallygamerjet/bsdiff) with repository-aware helpers for generating and serving package deltas.

A delta is a compact binary patch that transforms one version of a package into another. Clients that already have version N can download a delta instead of the full package for version N+1, saving significant bandwidth.

Example savings: a 50MB browser package update may produce a 2-5MB delta.

Index

Constants

View Source
const MaxInputSize = 64 << 20

MaxInputSize is the largest old/new input (bytes) Generate accepts. bsdiff needs several times the input size in memory, so this bounds worst-case use.

Variables

View Source
var (
	ErrInputTooLarge = errors.New("input too large for delta generation")
)

Sentinel errors for delta operations.

Functions

func Generate

func Generate(oldData, newData []byte) ([]byte, string, error)

Generate computes a binary diff patch from oldData to newData using bsdiff. The returned patch can be applied to oldData to reconstruct newData exactly. Returns the patch bytes and its SHA-256 hex digest.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL