This commit is contained in:
2026-06-13 08:01:42 +03:00
parent bf22e9a85e
commit aca0252cfd
19 changed files with 2001 additions and 1240 deletions

View File

@@ -105,7 +105,7 @@ func (s *FreeList) save() error {
bin.PutUint32(buf[i:], pageNo)
i += ptrSize
}
bin.PutUint32(buf, util.CalcChecksum(buf[crcSize:]))
bin.PutUint32(buf, util.CalculateCRC32(buf[crcSize:]))
//
var (
file *os.File
@@ -158,7 +158,7 @@ func (s *FreeList) loadLastPage() error {
}
// check crc
checksum, _ := bin.GetUint32(buf[0:])
if util.CalcChecksum(buf[crcSize:]) != checksum {
if util.CalculateCRC32(buf[crcSize:]) != checksum {
return fmt.Errorf("page %d is corrupted", s.basePagesCount)
}
for i := crcSize; i < len(buf); i += ptrSize {