Repository navigation
Conversation
The crc32c codec spec stores the checksum as a little-endian uint32. The codec used the host byte order, so big-endian hosts wrote and expected checksums other implementations reject. Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
The
crc32ccodec now stores its checksum as a little-endian unsigned 32-bit integer on every host, as the crc32c codec specification requires. Previously it used the host byte order, so on big-endian hosts zarr-python wrote and expected checksums that other implementations reject.Agent notes
src/zarr/codecs/crc32c_.py: encode usednp.array([...], dtype=np.uint32).view("B")and decode usednp.uint32(...).tobytes(). Both give native byte order. A new_checksum_byteshelper returnsint.to_bytes(4, "little"), and both paths use it.numcodecs.*checksum codecs. numcodecs' own checksum codecs already use explicit<u4.Tests
test_crc32c_encoded_bytespins the stored bytes for three inputs, including the RFC 3720 check value ("123456789"→83 92 06 e3), and checks the round trip.test_crc32c_decode_rejects_mismatched_checksumchecks that decoding raises when the stored checksum is the right value in big-endian order.🤖 Generated with Claude Code