mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-06 20:54:20 +01:00
WIP 3-3
This commit is contained in:
25
src/Helpers/Base64.php
Normal file
25
src/Helpers/Base64.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
use Safe\Exceptions\UrlException;
|
||||
|
||||
class Base64
|
||||
{
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public static function base64_url_encode(string $input): string
|
||||
{
|
||||
return strtr(base64_encode($input), '+/=', '-_.');
|
||||
}
|
||||
|
||||
/** @throws UrlException */
|
||||
public static function base64_url_decode(string $input): string
|
||||
{
|
||||
return \Safe\base64_decode(strtr($input, '-_.', '+/='), true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user