PHPackages                             olcx/nb-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. olcx/nb-captcha

ActiveLibrary

olcx/nb-captcha
===============

captcha package for nbframework

08PHP

Since Aug 31Pushed 7y ago1 watchersCompare

[ Source](https://github.com/olcx/nb-captcha)[ Packagist](https://packagist.org/packages/olcx/nb-captcha)[ RSS](/packages/olcx-nb-captcha/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

nb-captcha
==========

[](#nb-captcha)

依赖nbframework框架的图形验证码类库

安装
--

[](#安装)

> composer require olcx/nb-captcha

\##使用

\###在控制器里输出验证码

```
public function index($id = "") {
    $captcha = new Captcha([
       // 验证码字符集合
       'codeSet'  => '123456789',
       // 验证码字体大小(px)
       'fontSize' => 35,
       // 是否画混淆曲线
       'useCurve' => false,
       // 验证码图片高度
       'imageH'   => 80,
       // 验证码图片宽度
       'imageW'   => 320,
       // 验证码位数
       'length'   => 5,
       // 验证成功后是否重置
       'reset'    => true
    ]);
    $captcha->show($id);
 }

```

### 控制器里验证

[](#控制器里验证)

使用TP5的内置验证功能即可

```
$this->validate($data,[
    'captcha|验证码'=>'require|captcha'
]);

```

或者手动验证

```
if(!captcha_check($captcha)){
 //验证失败
};

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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/4ed7418d635d633d34008b8f73e7185bc61707ae5f67c86f8c209d2c60db0474?d=identicon)[nbcx](/maintainers/nbcx)

---

Top Contributors

[![nbcx](https://avatars.githubusercontent.com/u/33945405?v=4)](https://github.com/nbcx "nbcx (3 commits)")[![olcx](https://avatars.githubusercontent.com/u/6194544?v=4)](https://github.com/olcx "olcx (1 commits)")

### Embed Badge

![Health badge](/badges/olcx-nb-captcha/health.svg)

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

PHPackages © 2026

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