The header record of a
cdb database consists of the following:
struct header_cdb {
uint8_t magic[7];
uint8_t version;
uint8_t description[16];
uint32_t data_size;
uint32_t entries;
uint32_t entries_index;
uint32_t seed;
};
All fields are in Little Endian byte order.
This is followed by a description of the hash function of
entries_index records. The size of each index entry is the logarithm of
entries to base 256, rounded up.
The index records are followed by the start offsets of the entries, followed by
data_size. The offsets are relative to the end of the offset record table and are monotically increasing. The size of each offset record is the logarithm of
data_size to base 256, rounded up.
The offset table is followed by the entries in order. No separation or padding is added.