nx_hex.nx
buildroot/runtime/nx_hex.nx
about
nx_hex.nx -- hex + binary + byte dump helpers.
Every enterprise toolchain has a `hexdump` equivalent: raw byte
regions rendered in a stable human-readable format for
debugging memory state. This module provides three formats:
nx_hex_i64 i64 as 16-char hex (no prefix, no pad-space)
nx_hex_bytes byte array as `hh hh hh ...`
nx_hex_dump full hexdump-C-style: offset + 16 hex + ASCII
All write to stderr (fd 2) by default to avoid collision with
program stdout. Deterministic output -- no timestamps, no
tool-version headers. F6-compatible.
Enterprise grade means:
* fixed-width columns (sortable, greppable)
* ASCII fallback for unprintable bytes (prints '.')
* explicit region length (no overruns on short buffers)
* offset prefix shows 8-digit hex (up to 4 GB regions)
* no dependency on the filesystem -- pure fd write
Paired with nx_log (levels + tags) and nx_metrics (counters),
nx_hex closes the "what do I see when I'm lost" gap. Every
diagnostic should use ONE of: tagged log, numeric metric, or
hex dump. Nothing else.
dependencies 1 imports · 2 importers
imports: syscalls.nx
imported by: nx_optimizer_milestone_attest.nxnx_panic.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 37 | func nx_hex_nibble(n: i64) -> i64 |
| 44 | func nx_hex_i64(fd: i64, v: i64) -> i64 |
| 58 | func nx_hex_i64_n(fd: i64, v: i64, n: i64) -> i64 |
| 74 | func nx_hex_u8(fd: i64, b: i64) -> i64 |
| 84 | func nx_hex_bytes(fd: i64, buf: *u8, n: i64) -> i64 |
| 98 | func nx_hex_dump(fd: i64, buf: *u8, n: i64) -> i64 |
| 154 | func main() -> i64 |