43c51b300dbd

bump CHUNK_SIZE 1024→3200 and CODES_PER_COL 4→6 in shared codex-types

time
2026-05-17 14:57 UTC · 5 months ago
machine
koh2
parent
876f27087081
1 file src/shared/codex-types.ts+12 −7
src/shared/codex-types.ts+12 −7
@@ -152,13 +152,18 @@152152 // ── Constants — shared across generation and restoration ─────────────────────153153 154154 /**155- * Bytes of binary data per chunk. Each chunk becomes one Aztec code; this size156- * keeps the printed code at ~28mm (CODE_SIZE in PDF rendering) while staying157- * within Aztec's 1914-byte ECC-25% capacity for compact codes.155+ * Bytes of binary data per chunk. Each chunk becomes one Aztec code.158156  *159- * Conservative: leaves headroom for the JSON envelope overhead (~120 bytes).157+ * 3200 bytes base64url-encodes to ~4267 chars; combined with the JSON envelope158+ * overhead (~100 chars) the printed text is ~4367 chars — well under the159+ * bwip-js limit of 4999 chars at eclevel=25. DO NOT increase without re-running160+ * a bwip-js capacity test for the densest envelope.161+ *162+ * Sized to drive a typical vault down to ~6 A4 pages instead of ~24. Old163+ * Codexes printed with a smaller chunk size still restore — the erasure164+ * decoder derives shard size from the scanned chunks, not from this constant.160165  */161-export const CHUNK_SIZE = 1024;166+export const CHUNK_SIZE = 3200;162167 163168 /**164169  * Number of parity shards. With 2 parity shards, the Codex survives the loss@@ -170,9 +175,9 @@170175 /** Aztec error-correction percentage. 25% balances barcode density vs. resilience. */171176 export const AZTEC_ECC_PERCENT = 25;172177 173-/** PDF layout: 6 columns × 4 rows = 24 codes per A4 page. */178+/** PDF layout: 6 columns × 6 rows = 36 codes per A4 page. */174179 export const CODES_PER_ROW = 6;175-export const CODES_PER_COL = 4;180+export const CODES_PER_COL = 6;176181 export const CODES_PER_PAGE = CODES_PER_ROW * CODES_PER_COL;177182 178183 /** Stable storage keys for Codex bookkeeping. */

view file