magroski / wt
A library to quickly encode/decode web tokens
v1.0.3
2022-11-29 16:46 UTC
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: 2026-03-01 00:13:01 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');