php-simple-jwt/src/JwtUtil.php

16 lines
321 B
PHP
Raw Normal View History

2021-02-11 12:22:51 +00:00
<?php
namespace NoccyLabs\SimpleJwt;
class JwtUtil
{
public static function encode($data) {
return rtrim(str_replace(['+', '/'], ['-', '_'], base64_encode($data)), "=");
}
public static function decode($data) {
return base64_decode(str_replace(['-', '_'], ['+', '/'], $data));
}
}