Hello, and thank you for taking interest in my class.

ASCII CAPTCHA class is an innovative and brand new way to protect your website. If you've ever wondered how to avoid spambots or computer programs from automatically using a function on your website, you'll probably be recommended to use CAPTCHA, which stands for Completely Automated Public Turing test to tell Computers and Humans Apart.

For servers or browsers which cannot handle the standard CAPTCHA which displays graphical output, ASCII CAPTCHA is an innovative and still secure way to provide ASCII art for the use of CAPTCHA.

This class has gotten a considerable amount of feedback as well as notability, so I've made this documentation.

ASCII CAPTCHA class uses built in (standard) fonts to adjust, distort, and "noise" the characters within the output of the class. Aside from distortion, there is a considerable amount of flexability for the class.

For example, I've used this class for the development of a CMS. Here's a screenshot:

As you can see, it is extremely simple. Notice double randomized distortion of letters, randomized backgrounds, and also the ease of viewing it. In this case, you can plainly tell it is "FROJ62"

Special Properties

The class is very flexible. Here are a few properties and notes about what you can modify of the class to personalize or make better.

fonts property: This property allows you to specify an array, demonstrated in the constructor of the class, which contains each letter. You can add new characters, take characters away, and more. Aside from simply defining the characters, you can personalize the characters. The main font shows that the class is able to automatically treat the sides of a letter that it can access from left or right as background.

For example, the class treats fonts like this:

The whitespace on the edges are automatically considered "transparent". This means that the background layer of the class can exist behind the whitespace on the edges. The & characters are considered transparent symbols, meaning that the background should exist within the A and everywhere that edges to not directly conflict with whitespace.

In the case of the letter G:

In the above picture, on the left is a standard ASCII G. In order for the font to be recognized, so that characters that are not on the edge, & symbols must be placed, like on the right. Obviously, # is the character for the letter, although this can be customized.

The fonts system is unstable, although it works perfect. Please make sure within all fonts that the amount of lines are the same, and that there is a whitespace at the end of each character set. As long as it's configured perfect there should be no issues at all.

bgchar property: Within this property you can define the single character the the background should be. Please note that the background can be overwritten with random characters defined in the following property:

repset property: This "repset" property defines an array of characters the background can be replaced with, in order to further obfuscate the output.

repset_count property: This property is used to define the amount of background characters should be entered into the repset pool (see random_rep() method).

length property: This property defines the amount of characters to be used.

spacing property: the spacing between letters, by character count.

USAGE EXAMPLE

Note: If you do not know what passed by reference means, a good reference I'll pass to you is php.net.