How to generate random codes that have to be entered to access a Mailchimp form?

Can you precise your question ? Is it something you need to protect your form and avoid robots and spam ? If yes, I think you should use an existant CAPTCHA like Google reCaptcha or an alternative such as VisualCaptcha or Honeypot method.