Context: Forge M04 identity needs base32 for TOTP secrets and recovery-code display. Forge currently ships a temporary table-driven RFC 4648 implementation and tracks this as VL-TEXT-01.
Need:
base32_encode / base32_decode over std::span<const std::byte> in Void::Text, uppercase alphabet, optional padding on encode, case-insensitive decode, strict rejection of invalid characters and lengths.
No exceptions for malformed input; return std::optional or Void::Result.
Tests/gate: RFC 4648 §10 vectors, unpadded and padded forms, invalid alphabet/padding/length cases. Forge M04 swaps its temporary implementation for this.
Context: Forge M04 identity needs base32 for TOTP secrets and recovery-code display. Forge currently ships a temporary table-driven RFC 4648 implementation and tracks this as VL-TEXT-01.
Need:
- `base32_encode` / `base32_decode` over `std::span<const std::byte>` in `Void::Text`, uppercase alphabet, optional padding on encode, case-insensitive decode, strict rejection of invalid characters and lengths.
- No exceptions for malformed input; return `std::optional` or `Void::Result`.
Tests/gate: RFC 4648 §10 vectors, unpadded and padded forms, invalid alphabet/padding/length cases. Forge M04 swaps its temporary implementation for this.
Implemented in main as f158d7b: Void::Text::base32_encode(span<const std::byte>, bool pad = true) and Void::Text::base32_decode(string_view | span<const std::byte>, TextLimits) wrappers over the RFC 4648 codec merged for #43. Uppercase output, optional padding, case-insensitive strict decode (rejects invalid alphabet, impossible lengths, malformed padding and non-zero trailing bits) returning std::optional with no exceptions. RFC 4648 vectors and invalid cases are covered; Testing;Text with -Werror passes (539 tests, 536 passed, 3 skipped). Pushed to origin/main. Closing as done.
Implemented in `main` as `f158d7b`: `Void::Text::base32_encode(span<const std::byte>, bool pad = true)` and `Void::Text::base32_decode(string_view | span<const std::byte>, TextLimits)` wrappers over the RFC 4648 codec merged for #43. Uppercase output, optional padding, case-insensitive strict decode (rejects invalid alphabet, impossible lengths, malformed padding and non-zero trailing bits) returning `std::optional` with no exceptions. RFC 4648 vectors and invalid cases are covered; `Testing;Text` with `-Werror` passes (539 tests, 536 passed, 3 skipped). Pushed to origin/main. Closing as done.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Context: Forge M04 identity needs base32 for TOTP secrets and recovery-code display. Forge currently ships a temporary table-driven RFC 4648 implementation and tracks this as VL-TEXT-01.
Need:
base32_encode/base32_decodeoverstd::span<const std::byte>inVoid::Text, uppercase alphabet, optional padding on encode, case-insensitive decode, strict rejection of invalid characters and lengths.std::optionalorVoid::Result.Tests/gate: RFC 4648 §10 vectors, unpadded and padded forms, invalid alphabet/padding/length cases. Forge M04 swaps its temporary implementation for this.
Implemented in
mainasf158d7b:Void::Text::base32_encode(span<const std::byte>, bool pad = true)andVoid::Text::base32_decode(string_view | span<const std::byte>, TextLimits)wrappers over the RFC 4648 codec merged for #43. Uppercase output, optional padding, case-insensitive strict decode (rejects invalid alphabet, impossible lengths, malformed padding and non-zero trailing bits) returningstd::optionalwith no exceptions. RFC 4648 vectors and invalid cases are covered;Testing;Textwith-Werrorpasses (539 tests, 536 passed, 3 skipped). Pushed to origin/main. Closing as done.