Commit 6a8aaeec authored by zhujiashun's avatar zhujiashun

replace_crc32_ts: update

parent becf705b
......@@ -123,9 +123,9 @@ static const uint32_t crctab[] = {
uint32_t crc32_ts(const void* data, size_t len) {
const uint8_t* p = (const uint8_t*)data;
uint32_t crc = -1;
for (size_t i = 0; i < len; ++i, p++) {
crc = (crc << 8) ^ crctab[(crc >> 24) ^ *p];
uint32_t crc = 0xffffffff;
for (size_t i = 0; i < len; ++i) {
crc = (crc << 8) ^ crctab[(crc >> 24) ^ *p++];
}
return crc;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment