Repository navigation
Add crc64c support - #138
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #138 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 30 31 +1
Lines 2157 2170 +13
=====================================
- Misses 2157 2170 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will improve performance by 21.32%1 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing |
The native crc64c from fox-it#138 takes its input as a Vec<u8>, which pyo3 fills from a bytes object one Python int at a time. It now takes the same Buffer argument as crc32c. On Linux with Python 3.13, a 4 KiB input takes 7.7 us instead of 39.6 us. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HJvjcGbjsG74UunzfT5zNE
Summary
Adds CRC-64/NVME, the 64 bit counterpart to the existing
crc32c, in both apure Python and a native Rust implementation.
The layout follows
crc32cexactly, sodissect.util.hash.crc64cresolves tothe native version when the extension is available and falls back to Python
otherwise, with
crc64c_nativeandcrc64c_pythonavailable for picking oneexplicitly.
Parameters are polynomial
0xAD93D23594C93659, reflected, with all-ones initand xorout.
Test plan
tox run -e py3passes (163 passed, 63 skipped)crc64c(b"123456789") == 0xae8b14860a799888implementation rather than only against itself
updates composed via the
valueargumentcrc64cfixture runs every case against bothimplementations, matching how
crc32cis tested