Skip to content

Commit

Permalink
v.2.2.0
Browse files Browse the repository at this point in the history
* support scale distortion vs position distortion
* add option(distortion_type)
* update tests
  • Loading branch information
foo123 committed Aug 15, 2022
1 parent 0f18e12 commit 6e414d5
Show file tree
Hide file tree
Showing 13 changed files with 6,291 additions and 6,116 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Simple, image-based, mathematical captcha, with increasing levels of difficulty for PHP, JavaScript, Python

version **2.1.0**
version **2.2.0**

![SimpleCaptcha](/simple-captcha.jpg)

Expand All @@ -28,13 +28,17 @@ version **2.1.0**

**Example:**

1. Captcha with Position Distortion: ![Captcha with Position Distortion](/captcha-position.png)
2. Captcha with Scale Distortion: ![Captcha with Scale Distortion](/captcha-scale.png)


```php
// setup
$captcha = (new SimpleCaptcha())
->option('secret_key', 'SECRET_KEY')
->option('secret_salt', 'SECRET_SALT_')
->option('difficulty', 1) // 0 (easy) to 3 (difficult)
->option('distortion', ['1'=>4.0]) // custom image distortion per difficulty
->option('distortion_type', 1) // 1: position distortion, 2: scale distortion
->option('num_terms', 2)
->option('max_num_terms', 4) // -1 means constant num_terms
->option('min_term', 1)
Expand Down
Binary file added captcha-position.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added captcha-scale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6e414d5

Please # to comment.