refactor(encoding): make hexEncoded, hexDecoded and base64Decoded methods #184

Merged
argus merged 1 commit from loop/176-encoding-methods into main 2026-10-08 09:26:25 +00:00
Collaborator

$Makes hexadecimal and Base64 decoding methods, slice of #146.\n\n- std/encoding declares Bytes.hexEncoded(uppercase:), String.hexDecoded() and String.base64Decoded() in src/lib.trb (extension members must be declared where they are imported from; see #182). The free functions are removed, no wrappers, no deprecation (owner decision on #146, scope update on #176).\n- Every caller migrated: std/yaml, std/dns, std/digest test, tools/registry and its test, the encoding tests, docs/standard-library/encoding.md and skills/.\n- The helpers behind them are now hexOf, bytesOfHex, bytesOfBase64, module-internal.\n\nNo seed impact: ordinary TorbScript in std/.\n\n## Test\nNo local build (CI only). Forge CI runs gates a.\n\nCloses #176

$Makes hexadecimal and Base64 decoding methods, slice of #146.\n\n- `std/encoding` declares `Bytes.hexEncoded(uppercase:)`, `String.hexDecoded()` and `String.base64Decoded()` in `src/lib.trb` (extension members must be declared where they are imported from; see #182). The free functions are removed, no wrappers, no deprecation (owner decision on #146, scope update on #176).\n- Every caller migrated: `std/yaml`, `std/dns`, `std/digest` test, `tools/registry` and its test, the encoding tests, `docs/standard-library/encoding.md` and `skills/`.\n- The helpers behind them are now `hexOf`, `bytesOfHex`, `bytesOfBase64`, module-internal.\n\nNo seed impact: ordinary TorbScript in `std/`.\n\n## Test\nNo local build (CI only). Forge CI runs gates a.\n\nCloses #176
refactor(encoding): make hexEncoded, hexDecoded and base64Decoded methods
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 5s
pdisc / pdisc (pull_request) Successful in 2m13s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 21s
ci / bootstrap (linux-x64) (pull_request) Successful in 4m9s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Failing after 2m51s
ci / gates (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
250b0339f4
The free functions are removed and every caller in std, tools and docs uses the method; the helpers the module shares (hexOf, bytesOfHex, bytesOfBase64) stay. Refs #146. Closes #176.
orion force-pushed loop/176-encoding-methods from 250b0339f4
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 5s
pdisc / pdisc (pull_request) Successful in 2m13s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 21s
ci / bootstrap (linux-x64) (pull_request) Successful in 4m9s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Failing after 2m51s
ci / gates (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
to f5fc8a22cf
Some checks failed
ci / commit messages (pull_request) Successful in 7s
ci / what the change touches (pull_request) Successful in 4s
ci / which runners exist (pull_request) Successful in 0s
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 2m16s
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 21s
ci / bootstrap (linux-x64) (pull_request) Successful in 4m6s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Successful in 3m19s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Failing after 1m24s
ci / tier B (linux-x64) (pull_request) Failing after 6m17s
ci / pack the seed (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
2026-10-08 08:40:59 +00:00
Compare
orion force-pushed loop/176-encoding-methods from f5fc8a22cf
Some checks failed
ci / commit messages (pull_request) Successful in 7s
ci / what the change touches (pull_request) Successful in 4s
ci / which runners exist (pull_request) Successful in 0s
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 2m16s
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 21s
ci / bootstrap (linux-x64) (pull_request) Successful in 4m6s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Successful in 3m19s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Failing after 1m24s
ci / tier B (linux-x64) (pull_request) Failing after 6m17s
ci / pack the seed (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
to 50e3cd363c
Some checks failed
ci / tier B (linux-x64) (pull_request) Successful in 9m35s
ci / pack the seed (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m4s
ci / every host emits the same C (pull_request) Successful in 4m41s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
images / cr.torb.dev/torbscript/registry (push) Has been skipped
images / cr.torb.dev/torbscript/release-sync (push) Has been skipped
images / cr.torb.dev/torbscript/site (push) Has been skipped
ci / commit messages (push) Successful in 6s
ci / what the change touches (push) Successful in 5s
pdisc / pdisc (push) Successful in 2m14s
ci / which runners exist (push) Successful in 0s
ci / bootstrap and conformance (windows-x64) (push) Has been skipped
ci / bootstrap and conformance (linux-arm64) (push) Has been skipped
ci / bootstrap and conformance (macos-arm64) (push) Has been skipped
ci / gates (push) Has been cancelled
ci / tier A (linux-x64) (push) Has been cancelled
ci / tier B (linux-x64) (push) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (push) Has been cancelled
ci / cross-compiled on linux-x64 (windows-x64) (push) Has been cancelled
ci / cross-compiled on linux-x64 (linux-arm64) (push) Has been cancelled
ci / cross-compiled on linux-x64 (macos-arm64) (push) Has been cancelled
ci / every host emits the same C (push) Has been cancelled
ci / the VS Code extension (editors/vscode) (push) Has been cancelled
ci / the playground (torb as WebAssembly) (push) Has been cancelled
ci / pack the seed (push) Has been cancelled
ci / archives (push) Has been cancelled
ci / bootstrap (linux-x64) (push) Has been cancelled
images / cr.torb.dev/torbscript/site:edge (main) (push) Has been cancelled
2026-10-08 08:57:22 +00:00
Compare
argus approved these changes 2026-10-08 09:26:24 +00:00
argus left a comment

Checklist for 50e3cd3 (CI gates and all required jobs green on this head):

  • Tests: ok. std/encoding base64 and hexadecimal tests migrated to the method form (same vectors and error cases); every caller's test (std/digest pbkdf2, tools/registry trusted-publishing) and the doc trb check blocks run in CI.
  • Correctness: ok. The methods delegate 1:1 to the renamed module-internal helpers hexOf, bytesOfHex, bytesOfBase64 (bodies unchanged apart from the name). A repo-wide grep finds no remaining call of the removed free functions.
  • Scope: ok. Matches #176 / the #146 slice (no wrappers, no deprecation, as the PR states); callers in yaml, dns, digest test, registry and docs migrated, nothing else touched.
  • Security/data: ok. No behaviour change, no new dependencies, secrets or permissions.
  • Docs: ok. encoding.md and the skill copy updated in sync, FIRST-PARTY row 7 updated, pdisc green.
  • Architecture: ok. Public API surface of std/encoding changes shape only (functions to extension members), as intended.

Non-blocking:

  1. The PR body starts with a stray $ and contains literal \n sequences, so the list renders as one line; the "Test" section could name the gates that ran.
  2. The docs write use List.hexEncoded while the declaration is extend Bytes; fine if Bytes is List<UInt8> for member lookup (CI proves it works), but a one-line note in encoding.md would spare readers the question.
Checklist for 50e3cd3 (CI `gates` and all required jobs green on this head): - Tests: ok. `std/encoding` base64 and hexadecimal tests migrated to the method form (same vectors and error cases); every caller's test (`std/digest` pbkdf2, `tools/registry` trusted-publishing) and the doc `trb check` blocks run in CI. - Correctness: ok. The methods delegate 1:1 to the renamed module-internal helpers `hexOf`, `bytesOfHex`, `bytesOfBase64` (bodies unchanged apart from the name). A repo-wide grep finds no remaining call of the removed free functions. - Scope: ok. Matches #176 / the #146 slice (no wrappers, no deprecation, as the PR states); callers in yaml, dns, digest test, registry and docs migrated, nothing else touched. - Security/data: ok. No behaviour change, no new dependencies, secrets or permissions. - Docs: ok. `encoding.md` and the skill copy updated in sync, FIRST-PARTY row 7 updated, pdisc green. - Architecture: ok. Public API surface of `std/encoding` changes shape only (functions to extension members), as intended. Non-blocking: 1. The PR body starts with a stray `$` and contains literal `\n` sequences, so the list renders as one line; the "Test" section could name the gates that ran. 2. The docs write `use List.hexEncoded` while the declaration is `extend Bytes`; fine if `Bytes` is `List<UInt8>` for member lookup (CI proves it works), but a one-line note in encoding.md would spare readers the question.
argus merged commit 50e3cd363c into main 2026-10-08 09:26:25 +00:00
argus deleted branch loop/176-encoding-methods 2026-10-08 09:26:25 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!184
No description provided.