Archived from
http://sourceforge.net/docman/display_doc.php?docid=7273&group_id=30568, which
is sadly no longer available.
data files |
---|
Foobar.d01 Foobar.d02 Foobar.d03 Foobar.d04 Foobar.d05 Foobar.d06 Foobar.d07 Foobar.d08 Foobar.d09 Foobar.d10 |
parity volumes |
---|
Foobar.p01 Foobar.p02 Foobar.p03 |
Offset: | Type (Size) | Data |
---|---|---|
0x0000 | 8 Bytes | Identification String "PAR"\0 comment: -the string "PAR" followed by 5 null bytes |
0x0008 | 1 QWord | Version Number - The version number consists of two parts: The low Dword (bit 0..31) is the version - $00010000 for v01.00 The high Dword (bit 32..63) is a identifier for the generating program. The client can use it to see, which program generated the parity volume set. This may come in handy, if your program needs to know, if it was the generator itself. (Maybe to see, if it can use some proprietary bits in the status register or to notify, if new versions are out...) The coding is "program"-"version"-"subversion"-"subsubversion". "program" codes so far: 00 - undefined 01 - Mirror 02 - PAR Example: Mirror 0.2.1 has $01000201 as program identifier. |
0x0010 | 16 Bytes | control hash -a MD5 hash of the rest of the file starting from 0x0020 to the end -used to detect a corrupt file |
0x0020 | 16 Bytes | set hash -used as a identifier for the parity volume set Creation: Make a array of bytes (one dimendion, size=used files*16). Then put the MD5 hashes (not the MD516k hashes) there, starting with the first file. Use only the files, which are included in the parity data (status bit 0 = 1). Then calculate the MD5 hash of this array. |
0x0030 | 1 QWord | volume number -the number of the parity volume -0 for the PAR file -1 for .p01, 2 for .p02, 3 for .p03 etc. |
0x0038 | 1 QWord | number of files -the number of files stored in the parity volume set (only the input data files - the parity volumes are not counted) The files, which are not stored in the parity data, but in the file list for CRC checking, are counted too. So this is the number of files in the file list. |
0x0040 | 1 QWord | start offset of the file list -the start offset of the list of the stored files |
0x0048 | 1 QWord | file list size -the size of the file list in bytes |
0x0050 | 1 QWord | start offset of the data -the start offset of the data area |
0x0058 | 1 QWord | data size -the size of the data area in bytes |
0x0060 | ... | file list -This is the start of the list of the saved files. -it consists of file entrys |
Offset: | Type (Size) | Data |
---|---|---|
0x0000 | 1 QWord | entry size -the size of the file list entry in bytes -counting starts at 1, this record is counted too |
0x0008 | 1 QWord | status field -64 bits for status flags or numbers -currently only bit 0 and 1 are used: bit0 = 0 - file is not saved in the parity volume set bit0 = 1 - file is saved in the parity volume set bit1 = 0 - file is not checked successfully yet bit1 = 1 - file was successfully checked |
0x0010 | 1 QWord | size -the size of the stored file in bytes |
0x0018 | 16 Bytes | MD5 hash - a MD5 hash of the whole file |
0x0028 | 16 Bytes | 16k MD5 hash -a MD5 hash of the first 16384 Bytes of the file -if the file is smaller then 16k, only the existing bytes are used |
0x0038 | X Words | filename - the full filename with extension in Unicode ("foobar.d01") - paths are not allowed - no end indicators, you have to compute the size out of the entrysize (chars = (entrysize - 0x38) DIV 2) |