Skip to content

fix: validate checksum input before computing checksum#13

Merged
kpiljoong merged 1 commit into
mainfrom
fix/parse-checksum-validation-order
May 19, 2026
Merged

fix: validate checksum input before computing checksum#13
kpiljoong merged 1 commit into
mainfrom
fix/parse-checksum-validation-order

Conversation

@kpiljoong
Copy link
Copy Markdown
Collaborator

Summary

Validate the base ID before computing an optional checksum during parsing so malformed checksum-bearing input returns normal parse errors instead of reaching checksum helper panics.

This change:

  • defers checksum verification until after prefix, payload length, and Base32 validation
  • keeps checksum mismatch behavior unchanged for otherwise valid IDs
  • adds regression coverage for malformed checksum inputs that previously could panic

Tests:

  • go test ./...

Refs #11

@kpiljoong kpiljoong merged commit 94e6bb3 into main May 19, 2026
1 check passed
@kpiljoong kpiljoong deleted the fix/parse-checksum-validation-order branch May 19, 2026 14:34
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