PHPackages                             imyfone-tp/captcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. imyfone-tp/captcha

ActiveThink-cache[Security](/categories/security)

imyfone-tp/captcha
==================

A class of JWT captcha based on thinkphp5

v1.0.0(5y ago)2626Apache-2.0PHPPHP &gt;=5.6

Since Mar 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/febhz/captcha)[ Packagist](https://packagist.org/packages/imyfone-tp/captcha)[ RSS](/packages/imyfone-tp-captcha/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (0)

环境需求
----

[](#环境需求)

- PHP &gt;= 5.6

介绍
--

[](#介绍)

前后端分离使用的验证码

安装
--

[](#安装)

```
composer require imyfone-tp/captcha
```

使用
--

[](#使用)

发送验证码

```
//
use imyfone\TheCaptcha;
//自定义配置，可以用默认的不配置
$config=[
	'codeSet'  => '123456',
    // 验证码字符集合
    'expire'   => 1800,
    // 使用背景图片
    'fontSize' => 25,
    // 中文验证码字符串
    'useImgBg' => false,

    'length'   => 4,
    // 验证码位数
    'fontttf'  => '',
    // 验证码字体，不设置随机获取
];
$id = 'hello';//id随便定义一个，也可以不定义
$captcha = new TheCaptcha($config);
return $captcha->getEntry($id);
```

```
//验证操作
use imyfone\TheCaptcha;

$id = 'hello';//id与上面定义的id一致
$uniqid = $_POST['uniqid'];
$code = $_POST['code'];
$captcha = new TheCaptcha();
if($captcha->checkCaptcha($uniqid,$code,$id) === true){
	# 验证成功
}
else{
    # 验证失败
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1875d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e282daa3daf71bb57f7ee436d7764f0d0f2b9e0314d7c7c33341399e3be0dca?d=identicon)[febhz](/maintainers/febhz)

---

Top Contributors

[![febhz](https://avatars.githubusercontent.com/u/25316713?v=4)](https://github.com/febhz "febhz (3 commits)")

### Embed Badge

![Health badge](/badges/imyfone-tp-captcha/health.svg)

```
[![Health](https://phpackages.com/badges/imyfone-tp-captcha/health.svg)](https://phpackages.com/packages/imyfone-tp-captcha)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M212](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M112](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
