nx_hex_dump.nx
buildroot/runtime/nx_hex_dump.nx
about
nx_hex_dump.nx -- bits-up hex+ASCII dump of a byte buffer to an fd.
Replaces external tools (xxd, hexdump, hd) with a native NishiLang
primitive. Substrate diagnostics MUST use bits-up tools per
[[feedback-no-third-party-in-build-path-source-of-truth-is-bits-up]];
if reaching for Wireshark/xxd would diagnose the bug, the
substrate needs that capability natively.
Output format (16 bytes per line):
00000000 68 74 74 70 73 3a 2f 2f 65 78 61 6d 70 6c 65 2e |https://example.|
API:
nx_hex_dump_to_fd(fd, label, label_len, bytes, len) -- emit
labeled dump on fd (stderr is fd 2). label/label_len may be
0/0 for no label. Returns 0.
Per Cardinals 9 (single-responsibility -- one diagnostic primitive),
22 (composition over configuration -- callers choose fd).
license_tier: ORIGINAL
lineage_id: nishi_hex_dump_q10
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_hex_dump_kat_test.nxnx_wire_logger.nx
structs
| none |
consts
| none |
functions
| 25 | func _hexnib(v: i64) -> i64 |
| 30 | func _emit_offset(fd: i64, off: i64) -> i64 |
| 47 | func _emit_line(fd: i64, bytes: *u8, off: i64, total: i64) -> i64 |
| 95 | func nx_hex_dump_to_fd(fd: i64, label: *u8, label_len: i64, |
| 131 | func main() -> i64 |