code wiki / (root) / nx_swhid.nx

nx_swhid.nx

buildroot/runtime/nx_swhid.nx

3017 B69 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_swhid.nx -- thin CLI over nx_swhid_lib. Compute the ISO/IEC 18670:2025 identifier of a file. The construction lives in the LIB so this command line and any in-process consumer prove the SAME code, and so the gate can IMPORT the logic rather than fork this binary -- a fork is a boundary the mutation harness is blind across, and a gate that cannot be mutated returns a GREEN that reads like a proof while proving nothing. WHY A LIBRARIAN EMITS THIS ALONGSIDE ITS OWN sha256 AND NOT INSTEAD OF IT: the SWHID is what the WORLD can check -- computed identically by everyone, from the bytes alone, with no registry and no forge in the loop, and accepted as an identifier by SPDX 2.3 Annex F and DataCite 4.7. The sha256 plus byte length is what WE trust, because SHA-1 has chosen-prefix collisions (SHAttered, 2017) and is therefore an interoperable NAME, never tamper evidence. Emitting only the SWHID would be a downgrade wearing a standard's number. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_swhid_lib.nx nx_swhid.nx

imports: nx_syscalls.nxnx_swhid_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main swc_puts sys_write sw_len sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close swhid_cnt sys_mmap ↻ sw_cat sw_decimal sys_mmap ↻ sys_munmap ↻ sha1 sys_mmap ↻ sha1_process_block if_ge sw_hex sys_munmap ↻ swc_num sys_mmap ↻

structs

none

consts

none

functions

18func swc_puts(s: *u8) -> i64 { sys_write(1, s, sw_len(s)); return 0 }
called by 1: main calls 2: sys_writesw_len
20func swc_num(v: i64) -> i64
28func main(argc: i64, argv: *i64) -> i64