1 # File formats {#page_formats}
5 There are two file formats used by `librsync` and `rdiff`: the
6 *signature* file, which summarizes a data file, and the *delta* file,
7 which describes the edits from one data file to another.
9 librsync does not know or care about any formats in the data files.
11 All integers are big-endian.
15 All librsync files start with a `uint32` magic number identifying them. These are declared in `librsync.h`:
37 Signatures consist of a header followed by a number of block
40 Each block signature gives signature hashes
for one block of
41 `block_len` bytes from the input data file. The
final data block
42 may be shorter. The number of blocks in the signature is therefore
44 ceil(input_len/block_len)
52 The block signature contains a rolling or weak checksum used to find
53 moved data, and a strong hash used to check the match is correct.
54 The weak checksum is computed as in `rollsum.c`. The strong hash is
55 either MD4 or BLAKE2 depending on the magic number.
57 To make the signatures smaller at a cost of a greater chance of collisions,
58 the `strong_sum_len` in the header can cause the strong sum to be truncated
59 to the left after computation.
61 Each signature block format is (see `rs_sig_do_block`):
64 u8[strong_sum_len] strong_sum;
A signature file using the BLAKE2 hash.
A signature file with MD4 signatures.
static rs_result rs_sig_s_header(rs_job_t *)
State of trying to send the signature header.