Expand description
Binary-data helpers: the base64 JSON envelope and the hex dump.
kaish is UTF-8 text end to end, so binary values must be encoded the moment they cross a text boundary. Two encodings, two boundaries:
- base64 envelope — how a
Value::Bytes/ a binary result serializes for--jsonand MCP. Self-describing so an agent can act on it:{"_type":"bytes","encoding":"base64","data":"…","len":N}. - hex dump — how binary renders for a human (REPL):
xxd-style offset / hex columns / ASCII gutter.
See docs/binary-data.md.
Constants§
- BYTES_
ENVELOPE_ TYPE - The
_typediscriminator marking a base64 byte envelope.
Functions§
- bytes_
to_ envelope - Encode raw bytes as the self-describing base64 JSON envelope.
- envelope_
to_ bytes - Recognize the base64 byte envelope and decode it back to raw bytes.
- hex_
dump - Render bytes as an
xxd-style hex dump for human display.