pijul nest
guest [sign in]

Fixing a wrong CRC computation

pmeunier
Jul 30, 2021, 6:04 PM
HJ6VZ7HFS2YEQ5LSUJ35TKVS7LHAZ6FJO55ONDTQPUUI5VLRPP6AC

Dependencies

  • [2] W2MIZD5B Single file databases + CRC for the root pages (checking the other pages makes everything very slow)
  • [3] G4JEQLLX Debugging synchronisation
  • [4] HN6Z5DU4 Cleanup
  • [5] HCDD6FX7 Fixing some comments and reformatting
  • [6] WS4ZQM4R Debugging, tests, etc.
  • [*] OP6SVMOD Resetting history

Change contents

  • replacement in sanakirja-core/src/lib.rs at line 254
    [2.276][2.276:346]()
    hasher.update(core::slice::from_raw_parts(self.data, 4));
    [2.276]
    [2.346]
    // Remove the dirty bit.
    let x = [(*self.data) & 0xfe];
    hasher.update(&x[..]);
    hasher.update(core::slice::from_raw_parts(self.data.add(1), 3));
  • replacement in sanakirja-core/src/lib.rs at line 268
    [2.615][2.615:686]()
    let crc = unsafe { u32::from_le(*(self.data as *const u32)) };
    [2.615]
    [2.686]
    let crc = unsafe { u32::from_le(*(self.data as *const u32).add(1)) };