eru123/jwt

HS256/SHA256 JWT Implementation

Maintainers

Package info

github.com/eru123/php-jwt

pkg:composer/eru123/jwt

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0.1 2023-03-08 10:30 UTC

This package is auto-updated.

Last update: 2026-03-08 17:02:42 UTC


README

Simple and Straightforward JWT Library

<?php

require_once 'vendor/autoload.php';

use eru123\jwt\JWT;

$payload = [
    'hello' => 'world',
];
$key = 'secret';
$token = JWT::encode($payload, $key); // eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJoZWxsbyI6IndvcmxkIn0.bqxXg9VwcbXKoiWtp-osd0WKPX307RjcN7EuXbdq-CE
$decoded = JWT::decode($token, $key); // {"hello":"world"}