Skip to content

hash: implement fast crc32c #24279

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rexicon226
Copy link
Contributor

Implements an accelerated version of CRC-32C using the Intel SSE4.2 instruction. I'm not sure if anyone actually.. uses CRC-32C with Zig, but nevertheless it's a nice improvement. I've also spent a bit of time trying to describe how the algorithm implemented here works, although the math behind how combing CRC blocks is quite complex, so it doesn't go into too much detail.

I've fuzzed the algorithm for a bit with different sized inputs as well as making sure it produces the same result as the generic implementation.

image
You can find the benchmark here, https://gist.github.com/Rexicon226/e91d750f5842af43d96b2f0a526ba392

@Rexicon226 Rexicon226 force-pushed the fast-crc32c branch 3 times, most recently from d29bd45 to dfd034d Compare June 28, 2025 08:00
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.

2 participants