PHPackages                             hashwallet/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. hashwallet/hyperf-captcha

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

hashwallet/hyperf-captcha
=========================

captcha 验证码 算式验证码

194↓100%PHP

Since Sep 5Pushed 1y agoCompare

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

READMEChangelogDependenciesVersions (1)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)

\# 由于作者没有支持hyperf3.1 我重新拉的 当前版本支持 3.1以上 hyperf-captcha
==============

[](#hyperf-captcha)

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

功能特点
====

[](#功能特点)

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

安装
--

[](#安装)

使用 Composer 进行安装：

```
composer require hashwallet/hyperf-captcha
```

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

[](#生成config文件)

```
php bin/hyperf.php vendor:publish hashwallet/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

17

—

LowBetter than 6% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 Bus Factor1

Top contributor holds 75% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f46846684bab03363b0ecf80901ccb7faf57be102edbedfc45809adcbe25620c?d=identicon)[olsai](/maintainers/olsai)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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