PHPackages                             jsnlib/token - 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. jsnlib/token

ActiveLibrary

jsnlib/token
============

1.0.1(8y ago)036MITPHPPHP &gt;=7.0.0

Since Aug 8Pushed 8y agoCompare

[ Source](https://github.com/fdjkgh580/jsnlib-token)[ Packagist](https://packagist.org/packages/jsnlib/token)[ Docs](https://github.com/fdjkgh580/token)[ RSS](/packages/jsnlib-token/feed)WikiDiscussions master Synced 3d ago

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

jsnlib-token
============

[](#jsnlib-token)

簡單快速的產生 token 並驗證是否過期失效

```
require_once '../vendor/autoload.php';
$tk = new \Jsnlib\Token;

// 1. 加入使用鑰匙
$tk->key(uniqid('test132'));

// 2. 取得 Token 過期日
$expiry = $tk->expriy_date("Y-m-d H:i:s", "now", +1, "day");

// 3. 綁定編號，並加入過期日，可產生 Token
$token = $tk->create('ABC', $expiry);
/**
 * Jsnlib\Ao 輸出格式如
 * value => '42d398f2ecef48da5b4dab7e63c3323a8894048357ce8ba319dbec7ea847cb99'
 * expiry => '2017-08-15'
 */
// echo $token;

/**
 * 若要 JSON 格式如
 * array ( 'value' => '1a94b598b4067998b601221a47068cc31ac8fd6c3748abffec3e9046cd164cc5', 'expiry' => '2017-08-09 10:16:41', )
 */
// echo ($tk->json($token));

// 4. 檢查是否已經過期
if ( ! $is_expiry = $tk->is_expiry($token->expiry))
{
    echo "未過期";
}
else
{
    echo "已過期";
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

2968d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.0

1.0.1PHP &gt;=7.0.0

### Community

Maintainers

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

---

Top Contributors

[![fdjkgh580-2](https://avatars.githubusercontent.com/u/60056647?v=4)](https://github.com/fdjkgh580-2 "fdjkgh580-2 (5 commits)")

### Embed Badge

![Health badge](/badges/jsnlib-token/health.svg)

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

PHPackages © 2026

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