lgdz/jwt

无状态身份验证

1.0 2019-08-28 03:36 UTC

This package is auto-updated.

Last update: 2024-04-29 04:28:02 UTC


README

Install

composer require lgdz/jwt

Demo

try {

    $jwt = new Jwt('私钥', '公钥');
    
    //签发token
    $jwt->issue($data, 60);
    
    //验证token
    $jwt->check($token);
    
} catch (\Exception $e) {
    var_dump($e->getMessage());
}