diff --git a/src/leveled_sst.erl b/src/leveled_sst.erl index e232372..d0ac95a 100644 --- a/src/leveled_sst.erl +++ b/src/leveled_sst.erl @@ -1519,11 +1519,11 @@ crc_check_slot(FullBin) -> PosBL:32/integer, CRC32H:32/integer, Rest/binary>> = FullBin, - PosBL0 = min(PosBL, byte_size(FullBin) - 4), + PosBL0 = min(PosBL, byte_size(FullBin) - 3), % If the position has been bit-flipped to beyond the maximum paossible % length, use the maximum possible length <> = Rest, - case {hmac(Header), hmac(PosBL)} of + case {hmac(Header), hmac(PosBL0)} of {CRC32H, CRC32PBL} -> {Header, Blocks}; _ ->