magroski / wt
A library to quickly encode/decode web tokens
Installs: 3 172
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.1 || ^8
Requires (Dev)
- object-calisthenics/phpcs-calisthenics-rules: ^3.1
- phpstan/phpstan: ^0.10.0
- phpunit/phpunit: ^7.5
- roave/security-advisories: dev-master
- slevomat/coding-standard: 4.5
- squizlabs/php_codesniffer: *
This package is auto-updated.
Last update: 2024-10-29 05:28:59 UTC
README
This library provides a quick and simple way to encode/decode WebTokens.
Usage examples
# Passing the key on the constructor $wt = new WT('AES-256-CBC', 'abcdefgh', 'potato'); $object = new \stdClass(); $token = $wt->encode($object); $decoded = $wt->decode($token); # Passing the key during encode/decode $wt = new WT('AES-256-CBC', 'xkfo39sp'); $object = new \stdClass(); $token = $wt->encode($object, 'potato'); $decoded = $wt->decode($token, 'potato');