-
-
Notifications
You must be signed in to change notification settings - Fork 82.1k
Refactor: consolidate core SHA-256 digest helpers #99675
Copy link
Copy link
Closed
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.maintainerMaintainer-authored PRMaintainer-authored PR
Description
Activity
Metadata
Metadata
Assignees
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.maintainerMaintainer-authored PRMaintainer-authored PR
Type
Fields
Priority
None yet
Summary
Consolidate repeated core SHA-256 digest mechanics into a focused
src/infra/crypto-digest.tsowner while preserving domain-specific identifiers and compatibility-sensitive naming at call sites.Problem to solve
Core runtime code currently repeats one-shot SHA-256 hex/base64 wrappers, prefix truncation, and streaming file hashing. The duplicate implementations make byte/string input contracts, encodings, and error behavior harder to audit consistently, and two separate skill paths maintain equivalent streaming file hashers.
Proposed solution
Alternatives considered
node:cryptoprimitive already provides the required behavior.Impact
Affected: core maintainers and callers using repeated SHA-256 mechanics.
Severity: maintenance and auditability improvement; no intended user-visible behavior change.
Frequency: repeated across core cache keys, redacted identifiers, artifact validation, telemetry identifiers, and persisted records.
Consequence: fewer duplicate implementations and one tested contract for exact core digest mechanics.
Evidence/examples
The ranked shared-utility inventory identifies SHA/digest wrappers and short hash presentation as consolidation targets. The selected implementation slice removes two duplicate streaming file hashers and migrates 15 core callers while reducing production LOC.