But cannot result in either crc64 7341946071879767786 (little-endian) or 16921844136252138341 (big-endian) in the given example.
So, could anyone tell me
What is the poly value to be used by testers?
Which content in the example above should be included in the crc64 computation?
Is there anything I am missing in the calculation? For example, in this tool, I see that there are some more input fields rather than just the poly value.
It would be nice if you could use an online tool and give me the screenshot of the tool with the input/output.
Secondly, the Go package hash/crc64 DO REVERSE the current crc value when computing new crc, then DO REVERSE the new crc again. This logic is fixed in hash/crc64.
The tester using github.com/hdt3213/rdb v1.0.18. This package DO NOT REVERSE crc value at all.
Below is the code diff from both packages.
// code from hash/crc64
func update(crc uint64, tab *Table, p []byte) uint64 {
buildSlicing8TablesOnce()
crc = ^crc
// exclude same logic
return ^crc
}
// code from github.com/hdt3213/rdb
func update(crc uint64, tab *Table, p []byte) uint64 {
buildSlicing8TablesOnce()
// exclude same logic
return crc
}
I copied the code from hdt3213/rdb and tried to add the missing logic from hash/crc64. This produces the consistent result between 2 packages.
However, I cannot produce the crc in the example yet even with hdt3213/rdb and the correct poly. I will come back if I find something.