wp
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user