Class DefaultTextProducer

java.lang.Object
nl.captcha.text.producer.DefaultTextProducer
All Implemented Interfaces:
TextProducer

public class DefaultTextProducer extends Object implements TextProducer
Produces text of a given length from a given array of characters. The default (no-args) constructor produces five Latin characters from a specific set of alphanumerics. Characters such as "1" (one) and "l" (lower-case 'ell') have been removed to reduce ambiguity in the generated CAPTCHA.
Author:
James Childers
  • Constructor Details

    • DefaultTextProducer

      public DefaultTextProducer()
    • DefaultTextProducer

      public DefaultTextProducer(int length)
    • DefaultTextProducer

      public DefaultTextProducer(int length, char[] srcChars)
  • Method Details

    • getText

      public String getText()
      Description copied from interface: TextProducer
      Generate a series of characters.
      Specified by:
      getText in interface TextProducer
      Returns:
    • copyOf

      public static char[] copyOf(char[] original, int newLength)