Skip to content

Bump sha2 and rand; drop rand for getrandom - #20

Merged
Sbussiso merged 1 commit into
masterfrom
deps/rand-sha2
Sep 14, 2026
Merged

Sbussiso merged 1 commit into
masterfrom
deps/rand-sha2

Conversation

@Sbussiso

Copy link
Copy Markdown
Contributor

Two Dependabot bumps (#18, #19) that couldn't land as lockfile-only changes,
taken together with the call-site work they needed.

sha2 0.11 — the one that mattered

finalize() now returns a type that no longer implements LowerHex, so
format!("{:x}", ..) stopped compiling.

That function's output IS the stored key_hash. A silently different
encoding would orphan every license row rather than fail a build. The fixed
vector test still passes under 0.11:

test keys::tests::hash_matches_python_sha256_hexdigest ... ok

That's the evidence the encoding is unchanged — and exactly why the test was
written against a literal sha256("slk_test") rather than against the
implementation.

rand 0.10 — dropped instead

OsRng is gone from rand::rngs entirely. Rather than chase it across another
reshuffle, key generation calls getrandom::fill directly — that's what rand
was calling underneath, and for 16 bytes of key material the shorter, more
obviously-correct call is the better dependency. rand is removed.

24 tests pass, clippy clean. Supersedes #18 and #19.

🤖 Generated with Claude Code

Two Dependabot bumps that could not land as lockfile-only changes, taken
together with the call-site work they needed.

sha2 0.11 changed finalize() to return a type that no longer implements
LowerHex, so `format!("{:x}", ..)` stopped compiling. This function's
output IS the stored key_hash — a silently different encoding would
orphan every license row rather than fail a build. The fixed vector test
(sha256("slk_test")) still passes under 0.11, which is the evidence that
the encoding is unchanged, and is exactly why that test exists.

rand 0.10 removed OsRng from `rand::rngs` entirely. Rather than chase it
across another reshuffle, key generation now calls `getrandom::fill`
directly — that is what rand was calling underneath, and for 16 bytes of
key material the shorter, more obviously-correct call is the better
dependency. rand is dropped.

Supersedes the two Dependabot PRs, neither of which could carry a call
site change.

24 tests pass, clippy clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Sbussiso
Sbussiso merged commit 4f0ce6b into master Sep 14, 2026
5 checks passed
@Sbussiso
Sbussiso deleted the deps/rand-sha2 branch September 14, 2026 09:45
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