PHPackages                             wen-gg/webman-api-sign - 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. wen-gg/webman-api-sign

ActiveLibrary[API Development](/categories/api)

wen-gg/webman-api-sign
======================

适用于webman的api签名

v1.0.1(1y ago)114722MITPHP

Since Sep 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/wen-gg/webman-api-sign)[ Packagist](https://packagist.org/packages/wen-gg/webman-api-sign)[ RSS](/packages/wen-gg-webman-api-sign/feed)WikiDiscussions master Synced 1mo ago

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

webman-api-sign
===============

[](#webman-api-sign)

适用于webman的api签名

安装
==

[](#安装)

composer require wen-gg/webman-api-sign

配置
==

[](#配置)

```
return [
    'enable' => true,

    //
    'driver' => \Wengg\WebmanApiSign\Driver\ArrayDriver::class, //如有需要可自行实现BaseDriver
    'encrypt' => 'sha256', //加密方式
    'timeout' => 60, //timestamp超时时间秒，0不限制
    'table' => 'app_sign', //表名

    //字段对照，可从(header,get,post)获取的值
    'fields' => [
        'app_key' => 'appKey', //app_key
        'timestamp' => 'timestamp', //时间戳
        'noncestr' => 'noncestr', //随机字符串
        'signature' => 'signature', //签名字符串
    ],

    //driver为ArrayDriver时生效，对应table
    'app_sign' => [
        [
            'app_key' => '1661408635', //应用key
            'app_secret' => 'D81668E7B3F24F4DAB32E5B88EAE27AC', //应用秘钥
            'app_name' => '默认', //应用名称
            'status' => 1, //状态：0=禁用，1=启用
            'expired_at' => null, //过期时间，例如：2023-01-01 00:00:00，null不限制
        ],
    ],
];
```

签名计算
====

[](#签名计算)

注意：签名数据除业务参数外需加上app\_key，timestamp，noncestr对应的字段数据

1. 签名数据先按照键名升序排序
2. 使用 &amp; 链接签名数组（参数不转义，空数据不参与加密），再在尾部加上app\_secret
3. 再根据配置的加密方式 hash() 签名数据

示例
==

[](#示例)

排序前

```
{
    "a": "1",
    "b": [
        "你好世界",
        "abc123"
    ],
    "c": {
        "e": [],
        "d": "hello"
    },
    "appKey": "1661408635",
    "timestamp": "1662721474",
    "noncestr": "ewsqam"
}
```

排序后

```
{
    "a": "1",
    "appKey": "1661408635",
    "b": [
        "你好世界",
        "abc123"
    ],
    "c": {
        "d": "hello",
        "e": []
    },
    "noncestr": "ewsqam",
    "timestamp": "1662721474"
}
```

链接后

```
a=1&appKey=1661408635&b[0]=你好世界&b[1]=abc123&c[d]=hello&noncestr=ewsqam&timestamp=1662721474D81668E7B3F24F4DAB32E5B88EAE27AC

```

加密

```
$signature = hash('sha256', 'a=1&appKey=1661408635&b[0]=你好世界&b[1]=abc123&c[d]=hello&noncestr=ewsqam&timestamp=1662721474D81668E7B3F24F4DAB32E5B88EAE27AC');
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

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 ~704 days

Total

2

Last Release

634d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2995431c6adf71254a5ab86c5314d1ffb4a0387f14451a551194ddeebf42ee60?d=identicon)[zwj1206\_hi](/maintainers/zwj1206_hi)

---

Top Contributors

[![wen-gg](https://avatars.githubusercontent.com/u/17865026?v=4)](https://github.com/wen-gg "wen-gg (3 commits)")

---

Tags

apisignwebman

### Embed Badge

![Health badge](/badges/wen-gg-webman-api-sign/health.svg)

```
[![Health](https://phpackages.com/badges/wen-gg-webman-api-sign/health.svg)](https://phpackages.com/packages/wen-gg-webman-api-sign)
```

###  Alternatives

[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)[delatbabel/apisecurity

API Security Helpers.

1378.1k](/packages/delatbabel-apisecurity)

PHPackages © 2026

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