PHPackages                             sunsgne/hyperf-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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. sunsgne/hyperf-captcha

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

sunsgne/hyperf-captcha
======================

captcha 验证码 算式验证码

0.0.2(3y ago)7819↑91.5%1[1 issues](https://github.com/sunsgneayo/hyperf-captcha/issues)MITPHPPHP &gt;=8.0

Since Jan 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sunsgneayo/hyperf-captcha)[ Packagist](https://packagist.org/packages/sunsgne/hyperf-captcha)[ RSS](/packages/sunsgne-hyperf-captcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

 [![sunsgne](https://camo.githubusercontent.com/db2c48fed13718125a662dc35983cf565cd2281664e99d52cb24efcc8f3460a3/687474703a2f2f63646e2e6e696e65313132302e636e2f6c6f676f2d692e706e67)](https://camo.githubusercontent.com/db2c48fed13718125a662dc35983cf565cd2281664e99d52cb24efcc8f3460a3/687474703a2f2f63646e2e6e696e65313132302e636e2f6c6f676f2d692e706e67)

**sunsgne/hyperf-captcha**

**🐬 Verification code generator based on hyperf high-performance coroutine framework 🐬**

[![Latest Stable Version](https://camo.githubusercontent.com/3052fb41ec8e044ff9e92dc4d03f4ba20f5364e0e2630d7660512640d2ef12ae/687474703a2f2f706f7365722e707567782e6f72672f73756e73676e652f6879706572662d636170746368612f76)](https://packagist.org/packages/sunsgne/hyperf-captcha)[![Total Downloads](https://camo.githubusercontent.com/373f35cd97afaa0c918fdf72d3ee6930b30aa44da04a5a647959d1eaa8f1c336/687474703a2f2f706f7365722e707567782e6f72672f73756e73676e652f6879706572662d636170746368612f646f776e6c6f616473)](https://packagist.org/packages/sunsgne/hyperf-captcha)[![Latest Unstable Version](https://camo.githubusercontent.com/c856c251e6d35dfc2b83444372e6599c6e4835e2664afdc4d81e1f759a1f9511/687474703a2f2f706f7365722e707567782e6f72672f73756e73676e652f6879706572662d636170746368612f762f756e737461626c65)](https://packagist.org/packages/sunsgne/hyperf-captcha)[![License](https://camo.githubusercontent.com/8186df0334e4ec091e1dcee1769a9bedabb155816449089286e387d94b976b0d/687474703a2f2f706f7365722e707567782e6f72672f73756e73676e652f6879706572662d636170746368612f6c6963656e7365)](https://packagist.org/packages/sunsgne/hyperf-captcha)[![PHP Version Require](https://camo.githubusercontent.com/17176c4f53f8e28a763e6b4a2f951f1af1f78cc6022bf083dfa6f113f7e5c82d/687474703a2f2f706f7365722e707567782e6f72672f73756e73676e652f6879706572662d636170746368612f726571756972652f706870)](https://packagist.org/packages/sunsgne/hyperf-captcha)

hyperf-captcha
==============

[](#hyperf-captcha)

Hyperf Captcha 是一个专为[**hyperf**](https://github.com/hyperf/hyperf)协程框架设计的灵活可定制验证码组件，用于生成和展示验证码图片。它支持多种验证码类型，包括字符验证码和数学公式验证码。您可以根据需要轻松配置验证码的外观、大小和文字内容。本组件不提供存储机制（如 session、redis、文件等），完全由您自行实现存储和验证机制，使其适应性和灵活性更强。

功能特点
====

[](#功能特点)

- 多种验证码类型：支持字符验证码和数学公式验证码，满足不同的使用场景。
- 灵活配置：提供丰富的配置选项，方便定制验证码的样式、大小和文字内容。
- 高适应性：专为 Hyperf 协程框架打造，可轻松集成到您的项目中。
- 无存储机制：本组件不涉及验证码的存储和验证，完全由您根据实际情况实现，灵活自由。

安装
--

[](#安装)

使用 Composer 进行安装：

```
composer require sunsgne/hyperf-captcha
```

生成config文件
----------

[](#生成config文件)

```
php bin/hyperf.php vendor:publish sunsgne/hyperf-captcha
```

开始
--

[](#开始)

```
$Captcha = (new \Sunsgne\HyperfCaptcha\Captcha())->create();
var_dump($Captcha);
```

var\_dump：

```
{
"sensitive": false,
"key": "qcejdej2y",
"img": "data:imageXXXXXXX"
}
```

Preview
-------

[](#preview)

[![Preview](https://camo.githubusercontent.com/5796b984677c086025788097a4f9f89701595234cb98a23c7276c4ea5424c6ef/68747470733a2f2f696d6167652e6962622e636f2f6b5a784d4c6d2f696d6167652e706e67)](https://camo.githubusercontent.com/5796b984677c086025788097a4f9f89701595234cb98a23c7276c4ea5424c6ef/68747470733a2f2f696d6167652e6962622e636f2f6b5a784d4c6d2f696d6167652e706e67)

贡献与支持
-----

[](#贡献与支持)

欢迎贡献代码、提交问题和建议，共同改进本验证码组件，使其更加强大和灵活。如果您在使用过程中遇到任何问题或者需要帮助，请随时联系我们或者提交 Issue。

许可证
---

[](#许可证)

本项目基于 MIT 许可证 发布，可以自由使用、修改和分发。

说明
--

[](#说明)

- 非常感谢[mewebstudio/captcha](https://github.com/mewebstudio/captcha)作者的开源

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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

Every ~0 days

Total

2

Last Release

1221d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65843af70bae47cda80e0386c0640e2e17e1f8c8a12ea8fade3e1297237b26f3?d=identicon)[sunsgneayo](/maintainers/sunsgneayo)

---

Top Contributors

[![sunsgneayo](https://avatars.githubusercontent.com/u/51745500?v=4)](https://github.com/sunsgneayo "sunsgneayo (21 commits)")

---

Tags

phphyperf

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sunsgne-hyperf-captcha/health.svg)

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

PHPackages © 2026

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