// Slide, block and asset ids (spec ยง2.2): 12 characters of lowercase // base32, drawn from the platform's CSPRNG. The browser mints an id // before it calls applyOps, because the core never draws entropy and an // add_slide / add_block / duplicate_slide without ids is refused. // generate.mjs never calls this: a vector's ids come from its data file // so the vector is the same bytes every run. const ALPHABET = 'abcdefghijklmnopqrstuvwxyz234567' export const ID_LENGTH = 12 export function newID () { const bytes = new Uint8Array(ID_LENGTH) globalThis.crypto.getRandomValues(bytes) let out = '' for (const b of bytes) out += ALPHABET[b & 31] return out }