| // Readable code chars — no 0/O, 1/I confusion | |
| const CHARS = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789'; | |
| function generateCode() { | |
| const part = (n) => | |
| Array.from({ length: n }, () => CHARS[Math.floor(Math.random() * CHARS.length)]).join(''); | |
| return `${part(4)}-${part(4)}`; // e.g. AB3K-9X2M | |
| } | |
| module.exports = { generateCode }; | |