A library to quickly encode/decode web tokens

Maintainers

Details

github.com/magroski/wt

Source

Issues

Installs: 3 814

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/magroski/wt

v1.0.3 2022-11-29 16:46 UTC

This package is auto-updated.

Last update: 2025-09-29 02:42:20 UTC


README

Latest Stable Version Minimum PHP Version CircleCI GitHub license

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');