Skip to content

fix: encode baseline hashes without LowerHex formatting - #82

Merged
pixincreate merged 3 commits into
masterfrom
fix/sha2-hex-encoding
Aug 6, 2026
Merged

fix: encode baseline hashes without LowerHex formatting#82
pixincreate merged 3 commits into
masterfrom
fix/sha2-hex-encoding

Conversation

@pixincreate

@pixincreatepixincreate commented Aug 6, 2026

Copy link
Copy Markdown
Owner

What

sha2 0.11.0 changes hasher.finalize() to return hybrid_array::Array instead of GenericArray, which no longer implements LowerHex for {:x} formatting. src/baseline.rs:27 used format!("{:x}", hasher.finalize()), breaking compilation (E0277) on sha2 0.11.

Fix

Use hex::encode on the digest. Works on both sha2 0.10 (GenericArray) and 0.11 (hybrid_array::Array) since both implement AsRef<[u8]>.

Verification

  • cargo test with sha2 0.10.9 + hex 0.4.3: all suites pass (147 tests)
  • cargo test after temporarily bumping to sha2 0.11.0: all suites pass (E0277 gone); cargo clippy clean
  • Output identical to {:x} (existing hash_content_uses_expected_lowercase_hex test unchanged and passing)

Unblocks dependabot PR #80 (sha2 0.10.9 → 0.11.0).

@pixincreate
pixincreate merged commit 8bf1e78 into masterAug 6, 2026
6 checks passed
@pixincreate
pixincreate deleted the fix/sha2-hex-encoding branch August 6, 2026 10:07
@pixincreatepixincreate self-assigned this Aug 6, 2026
@pixincreatepixincreate added the enhancement New feature or request label Aug 6, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@pixincreate