Skip to content

Commit 1a409e9

Browse files
committed
add filter_hash_type to manifest
1 parent 8c13ef8 commit 1a409e9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/manifest.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ impl Manifest {
2626
writer.start("level_count")?;
2727
writer.write_u8(self.level_count)?;
2828

29+
writer.start("filter_hash_type")?;
30+
writer.write_u8(0)?; // 0 = XXH3
31+
2932
Ok(())
3033
}
3134
}
@@ -68,6 +71,20 @@ impl Manifest {
6871
// Currently level count is hard coded to 7
6972
assert_eq!(7, level_count, "level count should be 7");
7073

74+
{
75+
let filter_hash_type = {
76+
let section = toc
77+
.section(b"filter_hash_type")
78+
.expect("filter_hash_type section must exist in manifest");
79+
80+
let mut reader = section.buf_reader(path)?;
81+
reader.read_u8()?
82+
};
83+
84+
// Only one supported right now (and probably forever)
85+
assert_eq!(0, filter_hash_type, "filter_hash_type should be XXH3");
86+
}
87+
7188
Ok(Self {
7289
version,
7390
tree_type,

0 commit comments

Comments
 (0)