encoding: lead with methods for hexadecimal and Base64 (slice of #146) #176
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
std/encodinghexadecimal and Base64 decoding are used as methods:bytes.hexEncoded(uppercase:),text.hexDecoded(),text.base64Decoded().Part of #146 (methods are the preferred API style; owner direction 2026-10-06, first applied in #96 as
Digest.equalsConstantTimewithconstantTimeEqualkept as a thin wrapper). This slice follows exactly that pattern.Functions in scope
hexEncoded(onBytes),hexDecodedandbase64Decoded(onString) instd/encoding. Keep as free functions:structureOf<Value>()(no receiver),rendered, and theencode*/decode*/describe*helpers (generic derive plumbing, not receiver-first API). Revisitrendered(value)in a later round (blanketextendoverEncode).Source (pinned record)
usethe method like any member. If anextendwithout a trait on a type of another package turns out not to work instd/, stop and re-plan instead of working around it.Acceptance criteria
std/encodingprovidesBytes.hexEncoded(uppercase: Bool = false),String.hexDecoded()andString.base64Decoded()with the current result typesstd/encodinghexadecimal and base64 test files): method result equals free function result on the existing vectors, including upper/lower case, odd length and invalid digitsdeprecatedhere (the deprecation path is an open owner decision on #146).docs/standard-library/leads with the method in every example; the wrapper is listed as the older spelling. Examples are checked withtrb check;skills/is regenerated.compiler/srcandtools/keep calling the wrapper).Seed
No. Ordinary TorbScript in
std/only: no syntax change, no new native, no driver flag, no std name the compiler looks up by string. If that turns out wrong, stop and re-plan (two commits, seed refresh).Size
One PR, one Conventional Commit (
refactor(<module>): ...orfeat(<module>): ...), tests and docs in the same commit.Dependencies
Tracking epic: #146. No other dependency; independent of the other module slices.
[loop:torbscript] scope update from the owner decision on #146 (torben, 2026-10-08): the free functions covered by this slice are removed in the same PR that adds the methods, not kept as wrappers and not marked
deprecated. Migrate every caller in the repo (std, tests, examples, docs) to the method in the same PR. No lint migration rule needed.[loop:torbscript] claim implement by session:loop-torbscript-20261008 until 2026-10-08T14:10:00Z
[loop:torbscript] implement: PR #184 (#184) added
Bytes.hexEncoded,String.hexDecodedandString.base64Decodedas extension methods declared in std/encoding, and removed the free functions with no wrappers. Callers in std/yaml, std/dns, std/digest tests and tools/registry were migrated, docs and skills/ regenerated, and the pdisc summary shortened to fit the 240 limit. Tier A, bootstrap, release-sync/registry, pdisc and the other gates went green after two infracontext canceledflakes were retriggered. Argus has already merged the PR, so the issue is done. Worker token usage: not available to the worker, see the session record. next: review