FedericoBiccheddu / ascii-captcha

A very original ASCII Captcha.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ascii-captcha

A very original ASCII Captcha.

Build Status Scrutinizer Code Quality

Usage

/* Create an instance of the alphabet to use. */
$alphabet = new FedericoBiccheddu\AsciiCaptcha\Alphabet\DefaultAlphabet;

/* Init the main Captcha class */
$captcha = new FedericoBiccheddu\AsciiCaptcha\Captcha($alphabet);

/* Generate a random string */
$captcha->generateString();

/*
 * Display your ASCII generated code.
 * By default, toHtml() use self-close break. You can
 * set the first parameter "false" to use <br>
 */
echo $captcha->toHtml();

Example result for string "06YF2":

   *****     *******   **    **  ********   *******  
  **   **   **     **   **  **   **        **     ** 
 **   ****  **           ****    **               ** 
 ** *** **  ********      **     ******     *******  
 ****   **  **     **     **     **        **        
  **   **   **     **     **     **        **        
   *****     *******      **     **        ********* 

About

A very original ASCII Captcha.


Languages

Language:PHP 100.0%