Skip to content

Commit 16b3f8c

Browse files
brianpanefolkertdev
authored andcommitted
Add a comment to explain how Crc32HashCalc is sometimes Crc32C
1 parent d039173 commit 16b3f8c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

zlib-rs/src/deflate/hash_calc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ impl RollHashCalc {
142142
/// The methods of this struct can only be executed if the system has platform support, otherwise
143143
/// the result is UB. Use [`Self::is_supported()`] to check at runtime whether the system has
144144
/// support before executing any methods.
145+
///
146+
/// # Compatibility
147+
///
148+
/// The methods of this struct implement different CRC variants on different CPU types,
149+
/// for consistency with zlib-ng. For example, the x86 implementation computes CRC-32C,
150+
/// whereas the AArch64 implementation computes IEEE CRC-32. Therefore, this struct is
151+
/// suitable for internal hash table use, but not for generating portable checksums.
145152
pub struct Crc32HashCalc;
146153

147154
impl Crc32HashCalc {

0 commit comments

Comments
 (0)