siranta / phptoken
There is no license information available for the latest version (v1.1) of this package.
LibrerÃa para generar token
v1.1
2021-01-04 01:41 UTC
Requires
- jajo/jsondb: ^2.1
This package is auto-updated.
Last update: 2025-04-04 10:39:33 UTC
README
Installation
composer require siranta/phptoken
Create token
use siranta\phptoken;
$json = [
"init" => time(),
"exp" => time() + 60*10, // Token validity time
"data" => [
"id" => 12345678
]
];
$key = "25d55ad283aa400af464c76d713c07ad"; // Private key
$tt = new phptoken($json, $key);
echo $tt->encode();
decrypt token
$token = new phptoken(TOKEN, KEY);
echo $token->decode();