dframe / token
Token component Dframe
v4.2.0
2022-10-28 12:21 UTC
Requires
- php: >=7.3
- ext-json: *
- psr/simple-cache: ^1.0
Requires (Dev)
- dframe/session: ^4.1
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-11-28 16:56:25 UTC
README
Composer
$ composer require dframe/token
Standalone
use Dframe\Session\Session; use Dframe\Token\Token; $driver = new Session('sessionName'); /** * $driver Can be any class implements interface \Psr\SimpleCache\CacheInterface */ $token = new Token($driver); $key = $token->generate('evidenceToken')->get('evidenceToken'); // Generate hash $isValid = $token->isValid('evidenceToken', $key); // Return true/false $has = $token->has('evidenceToken'); // Return true/false
License
Open-sourced software licensed under the MIT license