Skip to content

The bloom frame

Worked example: footer revision 4 file

The bloom frame sits at offset 3872 and is 684 bytes sealed: a 5-byte frame header, a 647-byte raw body and the 32-byte trailer. The AAD is "stc" ‖ 0x01 ‖ file_id u64 ‖ 0u32. Bloom frames are always raw. See Bloom filter.

00 87 02 00 00 codec raw, block format 0, raw_len 0x0287 = 647

The body is 647 = 640 + 7 bytes.

  • 640 bytes of filter bits are 20 blocks of 32 bytes. Only the 500 keys that start with 'a' were hashed: 500 keys at 10 bits each is 5000 bits, which is ceil(5000 / 256) = 20 blocks.
  • 7 bytes of tail are the ranged tail, required because the footer sets both SKIP and RANGES:
00 | 01 62 | 03 00 00 00
n_tags 0 | one prefix: length 1, "b" | body_len 3

body_len counts from n_tags to the end of the prefixes: 1 byte for n_tags, 2 for the prefix. The prefix "b" is the bloom-off prefix this fixture was written with. Any key that starts with "b" was never added, so a reader must answer “maybe” for it. See Ext B: bloom off for how a table asks for this.