nx_metainfo.nx
buildroot/runtime/nx_metainfo.nx
about
nx_metainfo.nx -- .torrent metainfo loader (bits-up), reuses bencode + sha1.
module: nishi-core.torrent.metainfo
depends: nx_syscalls.nx, nx_bencode.nx, nx_sha1.nx
capability: CORE_COMPUTE
wired_status: FULLY_WIRED
Parse a .torrent: announce URL, info dict (name, piece length, total length),
and the INFO-HASH = SHA-1 over the raw bencoded `info` dict bytes (BEP-3) --
the identity used in tracker announces + peer handshakes. Reuses nx_bencode
(parse) + sha1 (hash); zero new crypto. The info-dict byte bounds come from
nx_bc_skip so the hash is over the exact on-wire bytes.
dependencies 3 imports · 2 importers
imports: nx_syscalls.nxnx_bencode.nxnx_sha1.nx
imported by: nx_metainfo_test.nxnx_torrent_mkinfo.nx
structs
| 18 | struct NxMetainfo |
consts
| 28 | const NX_METAINFO_BYTES: i64 = 64 // 8 * 8 |
| 29 | const NX_MI_OK: i64 = 1 |
| 30 | const NX_MI_BAD: i64 = 0 |
functions
| 33 | func nx_metainfo_parse(buf: *u8, n: i64, mi: *NxMetainfo, ih_out: *u8) -> i64 |