Skip to content

nogaems/faptcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

faptcha

Simple, lightweight and customizable CAPTCHA.

Usage

from faptcha import captcha

c = captcha.Captcha()
img, id = c.get()

After that img gets serialized captcha image (of type bytes) which contains some random text. id stores the sha256-hash of captcha text.

For example:

faptcha

To verify if the captcha text was recognized correctly:

c.check(id, code)

where code is the user-entered text of the captcha. If the captcha is recognized correctly, the function returns True, False otherwise.

Captcha class signature with default values:

Captcha(size=(150, 50), length=4, font_name='terminus.ttf', font_size=40,
             color=(0, 0, 0, 255), bg_color=(255, 255, 255, 0), storage_size=2**20)

Alphabet (with default terminus font):

faptcha

About

Simple and lightweight CAPTCHA

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages