Files
TijdVoorDeTest/src/Helpers/Base64.php
Marijn Doeve c70f713f7e
Some checks failed
CI / Tests (push) Failing after 9m39s
CI / Docker Lint (push) Successful in 4s
Refactor Base64 encoding/decoding methods for consistency, update controller routes, and improve CI configuration
2025-04-14 18:30:18 +02:00

22 lines
436 B
PHP

<?php
declare(strict_types=1);
namespace App\Helpers;
use Safe\Exceptions\UrlException;
class Base64
{
public static function base64UrlEncode(string $input): string
{
return rtrim(strtr(base64_encode($input), '+/', '-_'), '=');
}
/** @throws UrlException */
public static function base64UrlDecode(string $input): string
{
return \Safe\base64_decode(strtr($input, '-_', '+/'), true);
}
}