Compartir a través de


2.3 Content Information Data Structure Version 1.0

Content Information is a variable-size data structure. Content Information size is proportional to the length of the content it represents.

Content Information starts with a single 2-byte WORD value representing the data structure version. Version 1.0 of the Content Information data structure is formatted as follows. All fields are in little-endian byte order.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Version

dwHashAlgo

...

dwOffsetInFirstSegment

...

dwReadBytesInLastSegment

...

cSegments

...

segments (variable)

...

blocks (variable)

...

Version (2 bytes): Content Information version (0x0100 is version 1.0). The low byte is the minor version number and the high byte is the major version number. MUST be 0x0100.

dwHashAlgo (4 bytes): Hash algorithm to use.<2> MUST be one of the following values:

Value

Meaning

0x0000800C

Use the SHA-256 hash algorithm.

0x0000800D

Use the SHA-384 hash algorithm.

0x0000800E

Use the SHA-512 hash algorithm.

dwOffsetInFirstSegment (4 bytes): Number of bytes into the first segment within the Content Information data structure at which the content range begins.

dwReadBytesInLastSegment (4 bytes): Total number of bytes of the content range which lie within the final segment in the Content Information data structure.

The dwOffsetInFirstSegment and dwReadBytesInLastSegment fields are used to represent a content range which is specified by the content range start S and the content range length L, inclusive. S is relative to the start of the content and begins at 0. L cannot be less than 1 and S + L cannot exceed the length of the content range. S + L is the offset in the content range at which the content range ends. The values contained in the dwOffsetInFirstSegment and dwReadBytesInLastSegment fields are used to recalculate a given content range.

FirstSeg is the segment within which the content range start S lies. This segment is the first segment in the content range. LastSeg is the segment within which the content offset S + L lies. This segment is the final segment in the content range.

The value of the dwOffsetInFirstSegment field can range from 0 to Length(FirstSeg) - 1. The value of the content range start S is calculated by adding the content offset at which FirstSeg begins to the value of the dwOffsetInFirstSegment field.

The value of the dwReadBytesInLastSegment field can range from 0 to Length(LastSeg) - 1. When the value of the dwReadBytesInLastSegment field is 0, the content range contains the entire length of LastSeg. When the dwReadBytesInLastSegment field contains any other value, the content range includes the number of bytes of LastSeg equal to the specified value. The value of S + L (the content offset at which the content range ends) is calculated by adding the following to the content offset at which FirstSeg begins:

  • The value of the dwOffsetInFirstSegment field, and

  • The lengths of all the segments between FirstSeg and LastSeg, and

  • If the value of the dwReadBytesInLastSegment field is equal to 0, the value of Length(LastSeg), or

    If the value of the dwReadBytesInLastSegment field is greater than 0, the value of the dwReadBytesInLastSegment field.

cSegments (4 bytes): The number of segments which intersect the content range and hence are contained in the Content Information data structure.

segments (variable): Segment start offset, length, block size, SegmentHashofData and SegmentSecret for each segment. Each segment description is as specified in 2.3.1.1.

blocks (variable): Count of blocks and content block hashes for each block intersecting the content range for each segment in the Content Information data structure. Each set of blocks for a segment is as specified in 2.3.1.2.