In a previous job, I generated millions of unique codes. We only used a character set without confusable characters (0 vs O), vowels, etc. Captchas should do the same.