Files
php-simple-jwt/src/JWTUtil.php

16 lines
321 B
PHP
Raw Normal View History

2021-02-11 13:22:51 +01:00
<?php
2023-04-09 02:40:21 +02:00
namespace NoccyLabs\SimpleJWT;
2021-02-11 13:22:51 +01:00
2023-04-09 02:40:21 +02:00
class JWTUtil
2021-02-11 13:22:51 +01:00
{
public static function encode($data) {
return rtrim(str_replace(['+', '/'], ['-', '_'], base64_encode($data)), "=");
}
public static function decode($data) {
return base64_decode(str_replace(['-', '_'], ['+', '/'], $data));
}
}