Skip to content

Validate Base32 quantum lengths and padding - #506

Open
muneikh wants to merge 1 commit into
python-validators:masterfrom
muneikh:fix-base32-padding-and-length
Open

muneikh wants to merge 1 commit into
python-validators:masterfrom
muneikh:fix-base32-padding-and-length

Conversation

@muneikh

@muneikh muneikh commented Oct 11, 2026 •

Copy link
Copy Markdown

base32 currently checks only its alphabet, so impossible symbol counts and malformed padding such as A, AAA, AB= and ABCDEFGH= validate successfully. These inputs cannot form valid Base32 byte quanta.

Validate the final quantum lengths and their corresponding optional padding. Existing unpadded input support remains available. Twelve cases cover malformed input and all five valid final quantum forms, with and without padding.

Validation: seven malformed cases fail before the fix; all 1,125 tests pass. Full Ruff lint and formatting checks pass. Pyright reports nine existing crypto-address diagnostics; the exact same diagnostics reproduce on the unchanged checkout.

The final quantum sizes follow RFC 4648 section 6.

This branch has not been deployed

No deployments
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