PHPackages                             weijiajia/decrypt-verification-code - 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. [API Development](/categories/api)
4. /
5. weijiajia/decrypt-verification-code

ActiveLibrary[API Development](/categories/api)

weijiajia/decrypt-verification-code
===================================

A PHP package for decoding CAPTCHA verification codes using the jfbym.com cloud service API

0.0.2(1y ago)012MITPHPPHP ^8.0

Since Mar 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jackchang1025/decrypt-verification-code)[ Packagist](https://packagist.org/packages/weijiajia/decrypt-verification-code)[ RSS](/packages/weijiajia-decrypt-verification-code/feed)WikiDiscussions main Synced 1mo ago

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

Decrypt Verification Code
=========================

[](#decrypt-verification-code)

A PHP package for decoding CAPTCHA verification codes using the jfbym.com cloud service API.

Description
-----------

[](#description)

This package provides a simple interface for decrypting various types of verification code images by leveraging the jfbym.com API. It uses the Saloon HTTP client library for making API requests and handling responses.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require weijiajia/decrypt-verification-code
```

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- [Saloon](https://github.com/Sammyjo20/Saloon) HTTP client
- A valid API token from jfbym.com

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use Weijiajia\DecryptVerificationCode\CloudCode\CloudCodeConnector;

// Create a new connector instance
$connector = new CloudCodeConnector();

try {
    // Decode a verification code
    $response = $connector->decryptCloudCode(
        token: 'your-api-token',
        type: 'captcha-type-code', // Specific type code for the CAPTCHA format
        image: 'base64-encoded-image-data' // Base64 encoded image data
    );

    // Get the decoded verification code
    $code = $response->getCode();
    echo "Decoded CAPTCHA: " . $code;

} catch (DecryptCloudCodeException $e) {
    // Handle API-specific errors
    echo "API Error: " . $e->getMessage() . " (Code: " . $e->getCode() . ")";
} catch (\Exception $e) {
    // Handle other exceptions
    echo "Error: " . $e->getMessage();
}
```

### Response Structure

[](#response-structure)

The API response is mapped to a `CloudCodeResponse` object with the following structure:

```
CloudCodeResponse {
    public string $msg,
    public int $code,
    public Data $data {
        public int $code,
        public string $data, // The decoded verification code
        public float $time,
        public string $unique_code
    }
}
```

### With Logging

[](#with-logging)

The connector supports logging functionality via the `HasLogger` trait:

```
use Psr\Log\LoggerInterface;
use Weijiajia\DecryptVerificationCode\CloudCode\CloudCodeConnector;

// Create a PSR-3 compatible logger
$logger = /* your PSR-3 logger */;

// Create a connector with logging
$connector = new CloudCodeConnector();
$connector->setLogger($logger);

// Now API requests and responses will be logged
$response = $connector->decryptCloudCode(
    token: 'your-api-token',
    type: 'captcha-type-code',
    image: 'base64-encoded-image-data'
);
```

Error Handling
--------------

[](#error-handling)

The package throws a `DecryptCloudCodeException` when the API returns an error. The exception includes the error message and code from the API response.

```
try {
    $response = $connector->decryptCloudCode(/* ... */);
} catch (DecryptCloudCodeException $e) {
    // API returned an error
    echo "API Error: " . $e->getMessage() . " (Code: " . $e->getCode() . ")";
} catch (JsonException $e) {
    // JSON parsing error
    echo "JSON Error: " . $e->getMessage();
} catch (RequestException $e) {
    // Request failed
    echo "Request Error: " . $e->getMessage();
} catch (FatalRequestException $e) {
    // Fatal request error
    echo "Fatal Request Error: " . $e->getMessage();
}
```

API Reference
-------------

[](#api-reference)

### CloudCodeConnector

[](#cloudcodeconnector)

#### `decryptCloudCode(string $token, string $type, string $image): CloudCodeResponseInterface`

[](#decryptcloudcodestring-token-string-type-string-image-cloudcoderesponseinterface)

Sends a request to the jfbym.com API to decode a verification code image.

Parameters:

- `$token` - Your API authentication token
- `$type` - The type code that specifies the CAPTCHA format
- `$image` - Base64 encoded image data

Returns:

- A `CloudCodeResponseInterface` object containing the decoded verification code

License
-------

[](#license)

This package is open-sourced software licensed under the MIT license.

Credits
-------

[](#credits)

- \[Author Name\]
- \[All Contributors\]

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance45

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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

436d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/636557533fde1107bb301eca908de1c17c9ea7073d5c9c0fbad725ccd0800bde?d=identicon)[jackchang1025](/maintainers/jackchang1025)

---

Top Contributors

[![422066139](https://avatars.githubusercontent.com/u/1780162?v=4)](https://github.com/422066139 "422066139 (7 commits)")

---

Tags

apidecodecaptchaverificationjfbym

### Embed Badge

![Health badge](/badges/weijiajia-decrypt-verification-code/health.svg)

```
[![Health](https://phpackages.com/badges/weijiajia-decrypt-verification-code/health.svg)](https://phpackages.com/packages/weijiajia-decrypt-verification-code)
```

###  Alternatives

[saloonphp/laravel-plugin

The official Laravel plugin for Saloon

765.7M125](/packages/saloonphp-laravel-plugin)[recaptcha/php5

A properly coded PHP 5 reCaptcha class that will allow you to interact with Google's reCaptcha API.

48694.0k4](/packages/recaptcha-php5)

PHPackages © 2026

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