Documentation of signature file format

19 views
Skip to first unread message

michele...@gmail.com

unread,
Oct 19, 2015, 8:07:13 AM10/19/15
to librsync
Hello to all,

I need some documentation on the signature file format; I can't find it anywhere. In particular I'd like to know if I can retrieve the original file size having only the signature file.

Thanks,
M.B.

Martin Pool

unread,
Oct 19, 2015, 12:51:25 PM10/19/15
to michele...@gmail.com, librsync
All the documentation is in the tree. You should be able to get back the size.

--
You received this message because you are subscribed to the Google Groups "librsync" group.
To unsubscribe from this group and stop receiving emails from it, send an email to librsync+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michele Bertasi

unread,
Oct 20, 2015, 5:37:23 AM10/20/15
to Martin Pool, librsync
I've checked the source code in `mksum.c`, and this is my understanding of the format:

- 1 header;
- 1..N blocks;

The header format:
  - 32b magic number;
  - 32b (big endian) block length;
  - 32b (big endian) strong sum length;

A block format:
  - 32b (big endian) weak sum;
  - [strong sum length]B strong sum;

In this, I can't find any file length. The best approximation is maybe using block size X num blocks, but this is not very precise, since the last file block can be less than block size.
Am I correct?

Thank you for your time,
MB

Martin Pool

unread,
Nov 14, 2015, 12:32:00 PM11/14/15
to Michele Bertasi, librsync
Actually I think you're right, you cannot tell how long the last block is. I added this to https://github.com/librsync/librsync/issues/9 and made https://github.com/librsync/librsync/issues/46 for proper format documentation.
--
Martin

Michele Bertasi

unread,
Nov 14, 2015, 12:44:05 PM11/14/15
to Martin Pool, librsync
Thank you,
M.

Da: Martin Pool
Inviato: ‎14/‎11/‎2015 18:32
A: Michele Bertasi
Cc: librsync
Oggetto: Re: Documentation of signature file format

Reply all
Reply to author
Forward
0 new messages