code wiki / _hdl_build / nx_adnet_creative.nx

nx_adnet_creative.nx

buildroot/runtime/_hdl_build/nx_adnet_creative.nx

4787 B116 linesdepth 4pulls 4 transitivereach 12 importersview sourcekind librarytopic adnet
docsdependenciesstructsconstsfunctions

about

nx_adnet_creative.nx -- LIB: advertiser CREATIVE INTAKE for the sovereign ad network (debt 1785512202). THE CHICKEN-AND-EGG IT CLOSES: nx_adnet_selfserve accepts an inventory row whose img field must already be a FIRST-PARTY url -- but nothing ever let an advertiser produce one, so no client could onboard at all. CONTENT-ADDRESSED BY CONSTRUCTION. The stored name is derived from the BYTES, so: * replacing artwork MINTS A NEW URL -- the cache-busting problem solves itself and the creative can finally be served cacheable (today every page view re-pulls it under a blanket no-cache). * the same bytes always land on the same name -- re-upload is idempotent, never a duplicate. The digest is FNV-1a, a NON-CRYPTOGRAPHIC content hash. It is named that here on purpose: it is a cache key, NOT an integrity or authenticity claim, and must never be cited as one. THE SIZE CEILING IS A REFUSAL, NOT A GUIDELINE. The four house banners are 196,733 bytes each of UNCOMPRESSED png -- a 728x90 banner roughly ten times heavier than it should be, re-fetched on every page view. A platform that merely hopes clients upload small files will host that class forever, so an oversize creative is REFUSED at intake with a named reason. Weight is an advertiser-facing quality problem: a banner that slows the host page reflects on the client who paid for it. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_adnet_slot.nx nx_adnet_creative.nx nx_adnet_creative_gate.nx nx_mgmt_data.nx

imports: nx_syscalls.nxnx_adnet_slot.nx

imported by: nx_adnet_creative_gate.nxnx_mgmt_data.nx

structs

none

consts

21const ACR_W: i64 = 728
22const ACR_H: i64 = 90
23const ACR_MAX_BYTES: i64 = 65536
24const ACR_MIN_BYTES: i64 = 68
53const ACR_OK: i64 = 1
54const ACR_NOT_PNG: i64 = 2
55const ACR_BAD_DIMS: i64 = 3
56const ACR_TOO_HEAVY: i64 = 4

functions

27func acr_be32(b: *u8, off: i64) -> i64
called by 2: acr_widthacr_height
32func acr_is_png(b: *u8, n: i64) -> i64
49func acr_width(b: *u8, n: i64) -> i64 { if acr_is_png(b, n) == 0 { return 0 - 1 } return acr_be32(b, 16) }
called by 2: acr_validatemain calls 2: acr_is_pngacr_be32
50func acr_height(b: *u8, n: i64) -> i64 { if acr_is_png(b, n) == 0 { return 0 - 1 } return acr_be32(b, 20) }
called by 2: acr_validatemain calls 2: acr_is_pngacr_be32
58func acr_validate(b: *u8, n: i64) -> i64
66func acr_reason(v: i64, out: *u8) -> i64
77func acr_digest(b: *u8, n: i64) -> i64
called by 1: acr_name
90func acr_name(b: *u8, n: i64, out: *u8, cap: i64) -> i64
108func acr_url(b: *u8, n: i64, out: *u8, cap: i64) -> i64