code wiki / _hdl_build / nx_adnet_creative.nx
nx_adnet_creative.nx
buildroot/runtime/_hdl_build/nx_adnet_creative.nx
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
imports: nx_syscalls.nxnx_adnet_slot.nx
imported by: nx_adnet_creative_gate.nxnx_mgmt_data.nx
structs
| none |
consts
| 21 | const ACR_W: i64 = 728 |
| 22 | const ACR_H: i64 = 90 |
| 23 | const ACR_MAX_BYTES: i64 = 65536 |
| 24 | const ACR_MIN_BYTES: i64 = 68 |
| 53 | const ACR_OK: i64 = 1 |
| 54 | const ACR_NOT_PNG: i64 = 2 |
| 55 | const ACR_BAD_DIMS: i64 = 3 |
| 56 | const ACR_TOO_HEAVY: i64 = 4 |
functions
| 27 | func acr_be32(b: *u8, off: i64) -> i64 |
| 32 | func acr_is_png(b: *u8, n: i64) -> i64 |
| 49 | func acr_width(b: *u8, n: i64) -> i64 { if acr_is_png(b, n) == 0 { return 0 - 1 } return acr_be32(b, 16) } |
| 50 | func acr_height(b: *u8, n: i64) -> i64 { if acr_is_png(b, n) == 0 { return 0 - 1 } return acr_be32(b, 20) } |
| 58 | func acr_validate(b: *u8, n: i64) -> i64 |
| 66 | func acr_reason(v: i64, out: *u8) -> i64 |
| 77 | func acr_digest(b: *u8, n: i64) -> i64 called by 1: acr_name |
| 90 | func acr_name(b: *u8, n: i64, out: *u8, cap: i64) -> i64 |
| 108 | func acr_url(b: *u8, n: i64, out: *u8, cap: i64) -> i64 |