All Projects → dchest → fossil-delta-js

dchest / fossil-delta-js

Licence: other
Fossil SCM delta compression in JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
shell
77523 projects

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].