for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the tmilos/jose-jwt package.
*
* (c) Milos Tomic <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Tmilos\JoseJwt\Util;
class UrlSafeB64Encoder
{
/**
* @param string $data
* @return string
public static function encode($data)
$b64 = base64_encode($data);
$b64 = str_replace(
array('+', '/', '\r', '\n', '='),
array('-', '_'),
$b64
);
return $b64;
}
* @param string $b64
public static function decode($b64)
array('+', '/'),
return base64_decode($b64);