src/Rehyved/Utilities/Base64Url.php
public static function decode(string $arg)
    {
        $s = $arg;
        $s = str_replace('-', '+', $s);
        $s = str_replace('_', '/', $s);

        switch (strlen($s) % 4) {
            case 0:
                break;
            case 2:
                $s .= "==";
                break;
            case 3:
                $s .= "=";
                break;
            default:
                throw new \Exception("Illegal base64url string!");
        }

        return base64_decode($s);
    }
public static function decode(string $arg)
    {
        $s = $arg;
        $s = str_replace('-', '+', $s);
        $s = str_replace('_', '/', $s);

        switch (strlen($s) % 4) {
            case 0:
                break;
            case 2:
                $s .= "==";
                break;
            case 3:
                $s .= "=";
                break;
            default:
                throw new \Exception("Illegal base64url string!");
        }

        return base64_decode($s);
    }
public static function decode ( string $ arg ) { $ s = $ arg ; $ s = str_replace ( '-' , '+' , $ s ) ; $ s = str_replace ( '_' , '/' , $ s ) ; switch ( strlen ( $ s ) % 4 ) { case 0 : break ; case 2 : $ s .= "==" ; break ; case 3 : $ s .= "=" ; break ; default : throw new \ Exception ( "Illegal base64url string!" ) ; } return base64_decode ( $ s ) ; }
Decodes the specified string.
@param string $arg
@return bool|string
@throws \Exception Illegal base64url string
Decodes the specified string .