captcha-canvas API Documentation - v3.3.4
    Preparing search index...

    Function randomText

    • Generates a random uppercase hexadecimal string of specified length.

      Uses cryptographically secure random bytes to generate unpredictable CAPTCHA text that is difficult for automated systems to predict or brute force.

      Parameters

      • characters: number

        Number of characters to generate

      Returns string

      Random uppercase hexadecimal string

      const captchaText = randomText(6); // e.g., "A3F7B2"
      
      const secureText = randomText(8); // e.g., "D4C9E1A7"