PHPackages                             jeferwang/signature - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. jeferwang/signature

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

jeferwang/signature
===================

Signature for api access validate

v1.1.0(6y ago)2671MITPHPPHP &gt;=5.6.1

Since Nov 6Pushed 6y ago1 watchersCompare

[ Source](https://github.com/jeferwang/Signature)[ Packagist](https://packagist.org/packages/jeferwang/signature)[ RSS](/packages/jeferwang-signature/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (7)Used By (0)

使用说明
====

[](#使用说明)

客户端生成签名
-------

[](#客户端生成签名)

```
function test()
{
    $appid = '27834yrudfhao7rfouah';
    $appSecret = '0239urq98eurqwfff743q2yf8o7whaeofy3q74rhfoq7fghw';

    $params = [
        'id' => '123',
        'goods_id' => 'abcd123',
        'comment' => '测试Signature',
    ];

    $s = new Signature($appid, $appSecret, $params);
    var_dump($s->generate());
}

test();
```

请求中必须包含`appid`,`nonce`,`timestamp`,`signature`和参与签名的数据，不能多字段也不能少字段。

服务端验证签名
-------

[](#服务端验证签名)

```
$queryData = $request->all();
$appid = array_get($queryData, 'appid');
if (empty($appid)) {
    throw new \Exception("签名校验失败：appid must not empty");
}
$appAuth = ApiAuthModel::where(['appid' => $appid])->first();
if (!$appAuth) {
    throw new \Exception("签名校验失败：appid invalid");
}
$appSecret = $appAuth->app_secret;
$v = new SignatureValidate($queryData, $appSecret);
if (!$v->validate()) {
    throw new \Exception("签名校验失败：signature invalid");
}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

6

Last Release

2377d ago

PHP version history (3 changes)v1.0.0PHP 5.6

v1.0.2PHP ^5.6

v1.0.4PHP &gt;=5.6.1

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/jeferwang-signature/health.svg)

```
[![Health](https://phpackages.com/badges/jeferwang-signature/health.svg)](https://phpackages.com/packages/jeferwang-signature)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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