frowhy / 认证
认证类
v2.1.3
2016-12-21 03:33 UTC
Requires
- php: >=5.2
- ircmaxell/password-compat: ^1.0
README
安装
推荐通过 Packagist 和 Composer 安装。运行以下命令来安装此包并将其添加到项目的 composer.json
文件中
composer require frowhy/authentication
示例
use Frowhy\Authentication\Authentication; require_once __DIR__ . '/vendor/autoload.php'; header('Content-type: application/json'); $str = 'aaa'; $salt = 'bbb'; $make = Authentication::make($str, $salt); $state = Authentication::verify($make); $sign = Authentication::get($make, $salt); echo json_encode(['make' => $make, 'state' => $state, 'sign' => $sign]);