cli: add safe UTF-8 and supplied-buffer hex/base64 std modules
This commit is contained in:
42 files changed
+2807
-14
No files matched your search
@@ -224,3 +224,9 @@ A plain integer cannot distinguish a decoded zero from a short input. A trap on
|
||||
Short destination capacity needs explicit failure without partial mutation. A substring search's empty needle can match the end of empty data, so the existing single-byte length sentinel cannot unambiguously encode all outcomes. A returned split pair would hold borrows inside an aggregate before that source/lifetime surface is available. Arithmetic operators currently either trap or wrap; buffer sizing needs a recoverable overflow result.
|
||||
|
||||
**Resolved in the STD-1b branch:** spec 16 §2.4 reuses `WriteResult` for copy, adds `FindResult` for substring search, and composes splitting from explicit caller-owned slices. Spec 16 §2.1.1 adds checked add/sub/mul for u64 and target-width usize with ordinary result enums. Wrapping stays with existing operators. No new borrowed aggregate, generic type, AIR instruction or arithmetic mode is introduced. RFC 0018 records this API policy; its status remains Proposed until owner acceptance.
|
||||
|
||||
## Q-030 — Strict text/encoding failures and destination state
|
||||
|
||||
UTF-8 needs a scalar-level iteration contract without an owning iterator. Hex/Base64 decoders need a choice between permissive input and one reproducible accepted encoding, plus a defined destination state when a bad byte appears after a valid prefix. Size calculations must not trap before reporting short capacity.
|
||||
|
||||
**Resolved in STD-2a:** spec 16 §2.5–§2.7 define UTF-8 next/validate with explicit offsets, lowercase hex output with case-insensitive ASCII decoding, and canonical padded standard Base64 with checked unused bits. Decoders validate all input before checking output capacity and before writing; invalid input wins over short output and both preserve the entire destination. Capacity guards avoid arithmetic overflow. RFC 0019 records the policy. No streaming state, URL-safe/permissive options, borrowed iterator or allocation is introduced. Formatting remains STD-2b.
|
||||
Reference in new issue
Block a user