lib/encoding/hex+test: Hare port (encode / decode / sizes)
Replaces the 19-line placeholder. Five entrypoints per
ref/hare/encoding/hex/hex.ha + README:13:
- invalid (!void) — mirrors errors::invalid (hex.ha:175 decodestr).
base32's !i32 is a pre-existing in-tree divergence; hex doesn't
carry it forward.
- encodedsize(n) = n*2 — derived from hex.ha:46-55 encode_writer
lowercase 2-chars-per-byte.
- decodedsize(n) = n/2 — inverse; hex.ha:158.
- encode(dst, src) i32 — lowercase output per README:13 + hex.ha:91.
- decode(dst, src) (i32 | invalid) — accepts lower / upper / mixed;
returns invalid on odd length (hex.ha:154) or non-hex char
(hex.ha:161-163).
Deferred (cite-and-defer, same pattern as base32/base64):
- newencoder / newdecoder — Hare's io::handle stream API; ww has no
io::handle integration yet.
- encodestr / decodestr — allocator-returning sum-result; needs
os.alloc-backed memio dynamic, not wired.
- dump — hexdump-with-ASCII view; needs io::handle + fmt::fprintf
into a write sink.
Test: lib/encoding/hex/hextest.ww 13 rows — sizes, encode_basic
(Hare's CAFEBABEDEADF00D verbatim), encode_zero / encode_ff /
encode_empty (nibble corners + sign-extend + table off-by-one),
decode_{lower,upper,mixed} (case acceptance), decode_{empty,
odd_length,bad_char,bad_char_mid} (error paths), roundtrip_all_bytes
(0..255 full nibble+shift family — Class B exerciser).
Driver test/wcc/979_hex_run.c slotted between 978_intdiv_signed and
980_memio_run.