From 1d24b7099670625e5baa15d35477c89cc32e61cd Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 8 Aug 2024 20:05:08 +0900 Subject: [PATCH] Use crc32() instead of crc32_z() Old zlib does not support crc32_z. The difference between the two is that crc32() takes an input size as an unsigned int while crc32_z() takes as size_t. For our use case, size is guranteed to be short, so crc32() is safe to use. --- common/crc32.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/crc32.cc b/common/crc32.cc index d77cf5d74d..d3f71783ad 100644 --- a/common/crc32.cc +++ b/common/crc32.cc @@ -49,7 +49,7 @@ u32 compute_crc32(u32 crc, u8 *buf, i64 len) { } tbb::parallel_for_each(shards.begin(), shards.end(), [](Shard &shard) { - shard.crc = crc32_z(0, shard.buf, shard.len); + shard.crc = crc32(0, shard.buf, shard.len); }); for (Shard &shard : shards)