# Crate fast_rsync

source ·## Expand description

A faster implementation of librsync in pure Rust.

This crate offers three major APIs:

- Signature::calculate(), which takes a block of data and returns a “signature” of that data which is much smaller than the original data.
- diff(), which takes a signature for some block A, and a block of data B, and returns a delta between block A and block B. If A and B are “similar”, then the delta is usually much smaller than block B.
- apply(), which takes a block A and a delta (as constructed by diff()), and (usually) returns the block B.

## Structs

- A signature with a block index, suitable for calculating deltas.
- An rsync signature.
- Options for Signature::calculate.
- Indicates that a signature was not valid.

## Enums

- Indicates that a delta could not be applied because it was invalid.
- Indicates that a delta could not be calculated

## Functions

- Apply
`delta`

to the base data`base`

, appending the result to`out`

. - Apply
`delta`

to the base data`base`

, writing the result to`out`

. Errors if more than`limit`

bytes would be written to`out`

. - Calculate a delta and write it to
`out`

. This delta can be applied to the base data represented by`signature`

to attempt to reconstruct`data`

.