import { randomBytes } from 'crypto' const usedIds = new Set() export const getRandomId = () => { while (true) { const id = randomBytes(4).toString('hex') if (!usedIds.has(id)) { usedIds.add(id) return id } } }