Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Castagnoli polynomial for CRC32 computation #971

Merged
merged 2 commits into from
Oct 25, 2017
Merged

Add support for Castagnoli polynomial for CRC32 computation #971

merged 2 commits into from
Oct 25, 2017

Conversation

wladh
Copy link
Contributor

@wladh wladh commented Oct 24, 2017

This is needed for Kafka 0.11 support as the new records' checksum is
computed with Castagnoli polynomial (previous versions of Kafka use
IEEE polynomial).
Issue #901

This is needed for Kafka 0.11 support as the new records' checksum is
computed with Castagnoli polynomial (previous versions of Kafka use
IEEE polynomial).
crc32_field.go Outdated
@@ -6,9 +6,17 @@ import (
"hash/crc32"
)

const (
crcIEEE = iota
crcCastagnoli
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why define these? you can just have newCRC32Field take the crc32-defined constant directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean I should use the polynomial constants directly? I could, as they are just ints, but it didn't seem very clean to me as the intent here is to represent an enumeration of supported polynomials in the context of Kafka protocol, not the polynomial itself.
But if you feel strongly about it, I can remove them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I meant, but I see your point. In that case it probably makes sense to explicitly type it (e.g. the way that compression codecs are) rather than using ints, since the polynomials themselves are just ints.

@eapache
Copy link
Contributor

eapache commented Oct 25, 2017

Looks like TravisCI is having infrastructure issues, but this is fine. Thanks!

@eapache eapache merged commit 34f7aff into IBM:master Oct 25, 2017
@wladh wladh deleted the crc32castagnoli branch October 26, 2017 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants