定制 blackcube/lockbot 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

blackcube/lockbot

最新稳定版本:1.1.0

Composer 安装命令:

composer require blackcube/lockbot

包简介

PHP version of Lockbot Captcha

README 文档

README

Installation

If you use Packagist for installing packages, then you can update your composer.json like this :

{
    "require": {
        "blackcube/lockbot": "*"
    }
}

Testing

To run the tests:

composer install
./vendor/bin/codecept build
./vendor/bin/codecept run

To check coverage report:

./vendor/bin/codecept run --coverage --coverage-html

Usage

Captcha class allows you to generate and verify POW CAPTCHA codes.

Generating CAPTCHA Codes

use blackcube\lockbot\Captcha;

$captcha = new Captcha();
$challenge = $captcha->generateChallenge(); // Generate a CAPTCHA challenge
// $challenge is an array with 'algorithm' and 'salt' and 'hash' keys
// ['algorithm' => 'sha256', 'salt' => 'random_salt', 'hash' => 'computed_hash']

Verifying CAPTCHA Codes

// $solution is the solution provided by the user ['salt' => 'challenge_salt', 'hash' => 'challenge_hash', 'algorithm' => 'challenge_algorithm', 'solution' => 'user_solution']
use blackcube\lockbot\Captcha;
$captcha = new Captcha(
    algorithm: $solution['algorithm'] // Use the same algorithm as the challenge);
);
$isValid = $captcha->verifySolution($solution['salt'], $solution['hash'], $solution['solution']); // Verify the provided solution

Main methods are:

  • Generate a CAPTCHA challenge
  • generateChallenge(): array
  • Verify a provided solution
  • verifySolution(string $salt, string $hash, string $solution): bool

Contributing

All code contributions - including those of people having commit access - must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.

Fork the project, create a feature branch , and send us a pull request.

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2025-08-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固