code wiki / (root) / nx_metainfo.nx

nx_metainfo.nx

buildroot/runtime/nx_metainfo.nx

2450 B65 linesdepth 3pulls 4 transitivereach 4 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_bencode.nx nx_sha1.nx nx_metainfo.nx nx_metainfo_test.nx nx_torrent_mkinfo.nx

imports: nx_syscalls.nxnx_bencode.nxnx_sha1.nx

imported by: nx_metainfo_test.nxnx_torrent_mkinfo.nx

structs

18struct NxMetainfo

consts

28const NX_METAINFO_BYTES: i64 = 64 // 8 * 8
29const NX_MI_OK: i64 = 1
30const NX_MI_BAD: i64 = 0

functions

33func nx_metainfo_parse(buf: *u8, n: i64, mi: *NxMetainfo, ih_out: *u8) -> i64