This commit is contained in:
2026-05-21 23:38:52 +03:00
parent 793df29e11
commit e7ec6083cb
21 changed files with 1234 additions and 1017 deletions

17
util/until.go Normal file
View File

@@ -0,0 +1,17 @@
package util
import (
"hash/crc32"
)
var (
castagnoliTable = crc32.MakeTable(crc32.Castagnoli)
)
func CalcChecksum(page []byte) uint32 {
return crc32.Checksum(page, castagnoliTable)
}
func IsValidChecksum(page []byte, checksum uint32) bool {
return crc32.Checksum(page, castagnoliTable) == checksum
}