SstFile.parse.footer.verify: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/SstFile.bend as SstFile Lines 1049-1063 of mylsm-lsm-store@0.6.0.1/src/SstFile.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&start_line=1049&end_line=1063 import Base import mylsm-lsm-store@0.6.0.1/src/MemTable.bend as MemTable import mylsm-lsm-store@0.6.0.1/src/Sstable.bend as Sstable import mylsm-lsm-store@0.6.0.1/src/hub_sha/sha256.bend as SHA import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes def parse.footer.verify( cursor: Bytes.Cursor, claimed: Bytes.Bytes, +level: U32, +total: U32, +block_count: U32, entries: List<&2, MemTable.Entry>, hashes: List<&1, Bytes.Bytes> ) -> Result<&1, &1, Error, Sstable.Table>: match cursor: case Bytes.Cursor{bytes, +pos, _, +end}: expected = SHA.sha256_packed_bytes(Bytes.concat( header_bytes(level, total, block_count) <> List.reverse(&1, Bytes.Bytes, hashes))) parse.footer.check(level, entries, U32.is_eq(pos, end), Bytes.eq(claimed, expected)) Uses (15): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Cursor https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=concat https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=eq https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/MemTable.bend&name=Entry https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&name=Error https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&name=header_bytes https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstFile.bend&name=parse.footer.check https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/Sstable.bend&name=Table https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/hub_sha/sha256.bend&name=sha256_packed_bytes