File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -164,9 +164,9 @@ function verifyLoroDocument(bytes) {
164164 // Read stored checksum (bytes 16-20, little-endian)
165165 const storedChecksum = readU32LE (bytes, 16 );
166166
167- // Calculate checksum of body (bytes 22 +)
168- const body = bytes .slice (22 );
169- const calculatedChecksum = xxHash32 (body , 0x4F524F4C );
167+ // Calculate checksum of encode_mode + body (bytes 20 +)
168+ const payload = bytes .slice (20 );
169+ const calculatedChecksum = xxHash32 (payload , 0x4F524F4C );
170170
171171 if (storedChecksum !== calculatedChecksum) {
172172 throw new Error (" Checksum mismatch" );
Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ Both `oplog_bytes` and `state_bytes` use a KV Store format based on SSTable (Sor
222222│ variable │ last_key (bytes) - only if !is_large │
223223├───────────────┼─────────────────────────────────────────────────┤
224224│ 4 │ Checksum (xxHash32, little-endian) │
225- │ │ Covers all block meta entries │
225+ │ │ Covers all block meta entries (excluding count) │
226226└───────────────┴─────────────────────────────────────────────────┘
227227```
228228
You can’t perform that action at this time.
0 commit comments