fossil-delta

Fossil SCM delta compression

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
fossil-delta
6411.0.25 years ago9 years agoMinified + gzip package size for fossil-delta in KB

Readme

Fossil SCM delta compression algorithm
The cool thing about it is that plain text inputs generate plain text deltas (binary inputs, of course, may generate binary deltas).

Build Status

Installation

$ npm install fossil-delta
or just download fossil-delta.min.js.
Direct usage:
<script src="fossil-delta.min.js"></script>

CommonJS:
var fossilDelta = require('fossil-delta')

Usage

fossilDelta.create(origin, target)

Returns a delta (as Array of bytes) from origin to target (any array-like object containing bytes, e.g. Uint8Array, Buffer or plain Array).

fossilDelta.apply(origin, delta, opts)

Returns target (as Array of bytes) by applying delta to origin.
Throws an error if it fails to apply the delta (e.g. if it was corrupted).
Optional argument opts can be
{
    verifyChecksum: false
}

to disable checksum verification (which is enabled by default.)

fossilDelta.outputSize(delta)

Returns a size of target for this delta.
Throws an error if it can't read the size from delta.