Skip to content

chore(deps): bump sha2 to 0.11.1 - #87

Merged
avelino merged 1 commit into
mainfrom
avelino/deps/sha2-0.11
Oct 20, 2026
Merged

avelino merged 1 commit into
mainfrom
avelino/deps/sha2-0.11

Conversation

@avelino

@avelino avelino commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

sha2 0.10.9 -> 0.11.1. digest 0.11 dropped io::Write on the hasher and LowerHex on the output (hybrid-array replaced generic-array), which is why #82 failed to compile at src/jvm/download.rs and src/pack/archive.rs.

file_sha256 reads the archive in 8 KiB chunks and calls update, the same way hash_file already 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::copy into the hasher and format!("{:x}", finalize()):

  • hello world -> b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
  • empty -> e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
  • 20_000 bytes of 0x5a -> 405c8ba2c927413959ba97acc3faa99ba5de1dcff545f15bafda781068878fae
  • hash_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 --locked and cargo build --release --locked
  • cargo +1.88 check --locked (Rust 1.88.0). Two unlock name-collision warnings in src/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.1
  • cargo clippy --all-targets -- -D warnings clean
  • cargo fmt --all -- --check clean
  • CI on this PR: Check, Format, Clippy, Test (ubuntu, macos, windows), Build Release, Examples, GitBook. All green.

Not tested: file_sha256 against a real Adoptium archive. The e2e job uses a local JDK (--java-home), so it exercises hash_file and the produced binary, and the known-vector tests cover the hex.

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
avelino force-pushed the avelino/deps/sha2-0.11 branch from c0f4459 to 89f086a Compare October 20, 2026 08:42
@avelino
avelino merged commit b78f85f into main Oct 20, 2026
8 checks passed
@avelino
avelino deleted the avelino/deps/sha2-0.11 branch October 20, 2026 08:43
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.

1 participant