Repository navigation
chore(deps): bump sha2 to 0.11.1 - #87
Merged
Merged
Conversation
digest 0.11 dropped io::Write on the hasher and LowerHex on the output, so the bump did not compile in the JDK checksum and the runtime hash. Both now feed the hasher with update() and print lowercase hex a byte at a time. The text matches sha2 0.10. sha2 0.11.1 needs Rust 1.88. Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
avelino
force-pushed
the
avelino/deps/sha2-0.11
branch
from
October 20, 2026 08:42
c0f4459 to
89f086a
Compare
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.
sha2 0.10.9 -> 0.11.1. digest 0.11 dropped
io::Writeon the hasher andLowerHexon the output (hybrid-arrayreplacedgeneric-array), which is why #82 failed to compile atsrc/jvm/download.rsandsrc/pack/archive.rs.file_sha256reads the archive in 8 KiB chunks and callsupdate, the same wayhash_filealready did. Both render the digest as lowercase hex, two digits per byte. That is the text{:x}printed with sha2 0.10, so JDK checksums and the runtime cache key stay the same.sha2 0.11.1 needs Rust 1.88. The prerequisite note in the docs is now 1.88+. digest 0.10 stays in the lockfile for hmac and pbkdf2, which zip still pulls in.
Supersedes #82
How it was tested
Before the bump, sha2 0.10.9 with
io::copyinto the hasher andformat!("{:x}", finalize()):hello world->b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b8550x5a->405c8ba2c927413959ba97acc3faa99ba5de1dcff545f15bafda781068878faehash_file("hello world")->b94d27b9934d3e08(first 16 hex chars)After the bump, the same strings are what these tests assert:
file_sha256_hello_world_matches_known_hex,file_sha256_empty_matches_known_hex,file_sha256_spans_multiple_read_chunks,hash_file_hello_world_is_sha256_prefix.cargo build --lockedandcargo build --release --lockedcargo +1.88 check --locked(Rust 1.88.0). Twounlockname-collision warnings insrc/jvm/mod.rs, already on main.cargo test --locked: 210 unit tests passed, 2 e2e passed (hello_world_with_shrink,custom_exit_code) on JDK 21.0.12.1cargo clippy --all-targets -- -D warningscleancargo fmt --all -- --checkcleanNot tested:
file_sha256against a real Adoptium archive. The e2e job uses a local JDK (--java-home), so it exerciseshash_fileand the produced binary, and the known-vector tests cover the hex.