diff options
author | Andrew Dolgov <[email protected]> | 2022-07-12 22:26:21 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-07-12 22:26:21 +0300 |
commit | 80d3db1dcf8fe9ca66d4e3f2e2116d3bc39ae2b4 (patch) | |
tree | 04b33bfb9c9368c4a31e287153abec690b9014e0 /vendor/paragonie/constant_time_encoding/src | |
parent | 4b6161892000cb2b8392dce92a9cf2cabdf2d20e (diff) |
upgrade idiorm to php8.1-patched version (aaronpk/idiorm)
Diffstat (limited to 'vendor/paragonie/constant_time_encoding/src')
11 files changed, 190 insertions, 94 deletions
diff --git a/vendor/paragonie/constant_time_encoding/src/Base32.php b/vendor/paragonie/constant_time_encoding/src/Base32.php index 7784bafbf..7508b3df6 100644 --- a/vendor/paragonie/constant_time_encoding/src/Base32.php +++ b/vendor/paragonie/constant_time_encoding/src/Base32.php @@ -2,8 +2,12 @@ declare(strict_types=1); namespace ParagonIE\ConstantTime; +use InvalidArgumentException; +use RangeException; +use TypeError; + /** - * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. + * Copyright (c) 2016 - 2022 Paragon Initiative Enterprises. * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -60,20 +64,20 @@ abstract class Base32 implements EncoderInterface /** * Encode into Base32 (RFC 4648) * - * @param string $src + * @param string $binString * @return string - * @throws \TypeError + * @throws TypeError */ - public static function encode(string $src): string + public static function encode(string $binString): string { - return static::doEncode($src, false, true); + return static::doEncode($binString, false, true); } /** * Encode into Base32 (RFC 4648) * * @param string $src * @return string - * @throws \TypeError + * @throws TypeError */ public static function encodeUnpadded(string $src): string { @@ -85,7 +89,7 @@ abstract class Base32 implements EncoderInterface * * @param string $src * @return string - * @throws \TypeError + * @throws TypeError */ public static function encodeUpper(string $src): string { @@ -97,7 +101,7 @@ abstract class Base32 implements EncoderInterface * * @param string $src * @return string - * @throws \TypeError + * @throws TypeError */ public static function encodeUpperUnpadded(string $src): string { @@ -182,6 +186,32 @@ abstract class Base32 implements EncoderInterface return \pack('C', $src + $diff); } + /** + * @param string $encodedString + * @param bool $upper + * @return string + */ + public static function decodeNoPadding(string $encodedString, bool $upper = false): string + { + $srcLen = Binary::safeStrlen($encodedString); + if ($srcLen === 0) { + return ''; + } + if (($srcLen & 7) === 0) { + for ($j = 0; $j < 7 && $j < $srcLen; ++$j) { + if ($encodedString[$srcLen - $j - 1] === '=') { + throw new InvalidArgumentException( + "decodeNoPadding() doesn't tolerate padding" + ); + } + } + } + return static::doDecode( + $encodedString, + $upper, + true + ); + } /** * Base32 decoding @@ -190,11 +220,15 @@ abstract class Base32 implements EncoderInterface * @param bool $upper * @param bool $strictPadding * @return string - * @throws \TypeError + * + * @throws TypeError * @psalm-suppress RedundantCondition */ - protected static function doDecode(string $src, bool $upper = false, bool $strictPadding = false): string - { + protected static function doDecode( + string $src, + bool $upper = false, + bool $strictPadding = false + ): string { // We do this to reduce code duplication: $method = $upper ? 'decode5BitsUpper' @@ -216,7 +250,7 @@ abstract class Base32 implements EncoderInterface } } if (($srcLen & 7) === 1) { - throw new \RangeException( + throw new RangeException( 'Incorrect padding' ); } @@ -287,6 +321,9 @@ abstract class Base32 implements EncoderInterface (($c4 << 7) | ($c5 << 2) | ($c6 >> 3)) & 0xff ); $err |= ($c0 | $c1 | $c2 | $c3 | $c4 | $c5 | $c6) >> 8; + if ($strictPadding) { + $err |= ($c6 << 5) & 0xff; + } } elseif ($i + 5 < $srcLen) { /** @var int $c1 */ $c1 = static::$method($chunk[2]); @@ -324,6 +361,9 @@ abstract class Base32 implements EncoderInterface (($c3 << 4) | ($c4 >> 1) ) & 0xff ); $err |= ($c0 | $c1 | $c2 | $c3 | $c4) >> 8; + if ($strictPadding) { + $err |= ($c4 << 7) & 0xff; + } } elseif ($i + 3 < $srcLen) { /** @var int $c1 */ $c1 = static::$method($chunk[2]); @@ -338,6 +378,9 @@ abstract class Base32 implements EncoderInterface (($c1 << 6) | ($c2 << 1) | ($c3 >> 4)) & 0xff ); $err |= ($c0 | $c1 | $c2 | $c3) >> 8; + if ($strictPadding) { + $err |= ($c3 << 4) & 0xff; + } } elseif ($i + 2 < $srcLen) { /** @var int $c1 */ $c1 = static::$method($chunk[2]); @@ -350,6 +393,9 @@ abstract class Base32 implements EncoderInterface (($c1 << 6) | ($c2 << 1) ) & 0xff ); $err |= ($c0 | $c1 | $c2) >> 8; + if ($strictPadding) { + $err |= ($c2 << 6) & 0xff; + } } elseif ($i + 1 < $srcLen) { /** @var int $c1 */ $c1 = static::$method($chunk[2]); @@ -359,6 +405,9 @@ abstract class Base32 implements EncoderInterface (($c0 << 3) | ($c1 >> 2) ) & 0xff ); $err |= ($c0 | $c1) >> 8; + if ($strictPadding) { + $err |= ($c1 << 6) & 0xff; + } } else { $dest .= \pack( 'C', @@ -367,10 +416,9 @@ abstract class Base32 implements EncoderInterface $err |= ($c0) >> 8; } } - /** @var bool $check */ $check = ($err === 0); if (!$check) { - throw new \RangeException( + throw new RangeException( 'Base32::doDecode() only expects characters in the correct base32 alphabet' ); } @@ -384,7 +432,7 @@ abstract class Base32 implements EncoderInterface * @param bool $upper * @param bool $pad * @return string - * @throws \TypeError + * @throws TypeError */ protected static function doEncode(string $src, bool $upper = false, $pad = true): string { diff --git a/vendor/paragonie/constant_time_encoding/src/Base32Hex.php b/vendor/paragonie/constant_time_encoding/src/Base32Hex.php index 68fdad52c..b868dd048 100644 --- a/vendor/paragonie/constant_time_encoding/src/Base32Hex.php +++ b/vendor/paragonie/constant_time_encoding/src/Base32Hex.php @@ -3,7 +3,7 @@ declare(strict_types=1); namespace ParagonIE\ConstantTime; /** - * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. + * Copyright (c) 2016 - 2022 Paragon Initiative Enterprises. * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/vendor/paragonie/constant_time_encoding/src/Base64.php b/vendor/paragonie/constant_time_encoding/src/Base64.php index 4739e4895..f5716179f 100644 --- a/vendor/paragonie/constant_time_encoding/src/Base64.php +++ b/vendor/paragonie/constant_time_encoding/src/Base64.php @@ -2,8 +2,12 @@ declare(strict_types=1); namespace ParagonIE\ConstantTime; +use InvalidArgumentException; +use RangeException; +use TypeError; + /** - * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. + * Copyright (c) 2016 - 2022 Paragon Initiative Enterprises. * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -38,13 +42,14 @@ abstract class Base64 implements EncoderInterface * * Base64 character set "[A-Z][a-z][0-9]+/" * - * @param string $src + * @param string $binString * @return string - * @throws \TypeError + * + * @throws TypeError */ - public static function encode(string $src): string + public static function encode(string $binString): string { - return static::doEncode($src, true); + return static::doEncode($binString, true); } /** @@ -54,7 +59,8 @@ abstract class Base64 implements EncoderInterface * * @param string $src * @return string - * @throws \TypeError + * + * @throws TypeError */ public static function encodeUnpadded(string $src): string { @@ -65,7 +71,8 @@ abstract class Base64 implements EncoderInterface * @param string $src * @param bool $pad Include = padding? * @return string - * @throws \TypeError + * + * @throws TypeError */ protected static function doEncode(string $src, bool $pad = true): string { @@ -119,8 +126,9 @@ abstract class Base64 implements EncoderInterface * @param string $encodedString * @param bool $strictPadding * @return string - * @throws \RangeException - * @throws \TypeError + * + * @throws RangeException + * @throws TypeError * @psalm-suppress RedundantCondition */ public static function decode(string $encodedString, bool $strictPadding = false): string @@ -141,12 +149,12 @@ abstract class Base64 implements EncoderInterface } } if (($srcLen & 3) === 1) { - throw new \RangeException( + throw new RangeException( 'Incorrect padding' ); } if ($encodedString[$srcLen - 1] === '=') { - throw new \RangeException( + throw new RangeException( 'Incorrect padding' ); } @@ -189,6 +197,9 @@ abstract class Base64 implements EncoderInterface ((($c1 << 4) | ($c2 >> 2)) & 0xff) ); $err |= ($c0 | $c1 | $c2) >> 8; + if ($strictPadding) { + $err |= ($c2 << 6) & 0xff; + } } elseif ($i + 1 < $srcLen) { $c1 = static::decode6Bits($chunk[2]); $dest .= \pack( @@ -196,14 +207,16 @@ abstract class Base64 implements EncoderInterface ((($c0 << 2) | ($c1 >> 4)) & 0xff) ); $err |= ($c0 | $c1) >> 8; - } elseif ($i < $srcLen && $strictPadding) { + if ($strictPadding) { + $err |= ($c1 << 4) & 0xff; + } + } elseif ($strictPadding) { $err |= 1; } } - /** @var bool $check */ $check = ($err === 0); if (!$check) { - throw new \RangeException( + throw new RangeException( 'Base64::decode() only expects characters in the correct base64 alphabet' ); } @@ -211,6 +224,36 @@ abstract class Base64 implements EncoderInterface } /** + * @param string $encodedString + * @return string + */ + public static function decodeNoPadding(string $encodedString): string + { + $srcLen = Binary::safeStrlen($encodedString); + if ($srcLen === 0) { + return ''; + } + if (($srcLen & 3) === 0) { + if ($encodedString[$srcLen - 1] === '=') { + throw new InvalidArgumentException( + "decodeNoPadding() doesn't tolerate padding" + ); + } + if (($srcLen & 3) > 1) { + if ($encodedString[$srcLen - 2] === '=') { + throw new InvalidArgumentException( + "decodeNoPadding() doesn't tolerate padding" + ); + } + } + } + return static::decode( + $encodedString, + true + ); + } + + /** * Uses bitwise operators instead of table-lookups to turn 6-bit integers * into 8-bit integers. * diff --git a/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php b/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php index 8ad2e2bf1..5e98a8f79 100644 --- a/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php +++ b/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php @@ -3,7 +3,7 @@ declare(strict_types=1); namespace ParagonIE\ConstantTime; /** - * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. + * Copyright (c) 2016 - 2022 Paragon Initiative Enterprises. * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/vendor/paragonie/constant_time_encoding/src/Base64DotSlashOrdered.php b/vendor/paragonie/constant_time_encoding/src/Base64DotSlashOrdered.php index dd1459e85..9780b14bb 100644 --- a/vendor/paragonie/constant_time_encoding/src/Base64DotSlashOrdered.php +++ b/vendor/paragonie/constant_time_encoding/src/Base64DotSlashOrdered.php @@ -3,7 +3,7 @@ declare(strict_types=1); namespace ParagonIE\ConstantTime; /** - * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. + * Copyright (c) 2016 - 2022 Paragon Initiative Enterprises. * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/vendor/paragonie/constant_time_encoding/src/Base64UrlSafe.php b/vendor/paragonie/constant_time_encoding/src/Base64UrlSafe.php index 1a4107527..8192c63d5 100644 --- a/vendor/paragonie/constant_time_encoding/src/Base64UrlSafe.php +++ b/vendor/paragonie/constant_time_encoding/src/Base64UrlSafe.php @@ -3,7 +3,7 @@ declare(strict_types=1); namespace ParagonIE\ConstantTime; /** - * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. + * Copyright (c) 2016 - 2022 Paragon Initiative Enterprises. * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/vendor/paragonie/constant_time_encoding/src/Binary.php b/vendor/paragonie/constant_time_encoding/src/Binary.php index 38dbc4e66..828f3e0f6 100644 --- a/vendor/paragonie/constant_time_encoding/src/Binary.php +++ b/vendor/paragonie/constant_time_encoding/src/Binary.php @@ -2,8 +2,10 @@ declare(strict_types=1); namespace ParagonIE\ConstantTime; +use TypeError; + /** - * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. + * Copyright (c) 2016 - 2022 Paragon Initiative Enterprises. * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -46,6 +48,8 @@ abstract class Binary public static function safeStrlen(string $str): int { if (\function_exists('mb_strlen')) { + // mb_strlen in PHP 7.x can return false. + /** @psalm-suppress RedundantCast */ return (int) \mb_strlen($str, '8bit'); } else { return \strlen($str); @@ -60,9 +64,10 @@ abstract class Binary * @staticvar boolean $exists * @param string $str * @param int $start - * @param int $length + * @param ?int $length * @return string - * @throws \TypeError + * + * @throws TypeError */ public static function safeSubstr( string $str, diff --git a/vendor/paragonie/constant_time_encoding/src/EncoderInterface.php b/vendor/paragonie/constant_time_encoding/src/EncoderInterface.php index 7aeee55a8..9cafbf96c 100644 --- a/vendor/paragonie/constant_time_encoding/src/EncoderInterface.php +++ b/vendor/paragonie/constant_time_encoding/src/EncoderInterface.php @@ -3,7 +3,7 @@ declare(strict_types=1); namespace ParagonIE\ConstantTime; /** - * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. + * Copyright (c) 2016 - 2022 Paragon Initiative Enterprises. * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/vendor/paragonie/constant_time_encoding/src/Encoding.php b/vendor/paragonie/constant_time_encoding/src/Encoding.php index 896a66841..8649f31fc 100644 --- a/vendor/paragonie/constant_time_encoding/src/Encoding.php +++ b/vendor/paragonie/constant_time_encoding/src/Encoding.php @@ -2,8 +2,10 @@ declare(strict_types=1); namespace ParagonIE\ConstantTime; +use TypeError; + /** - * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. + * Copyright (c) 2016 - 2022 Paragon Initiative Enterprises. * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -36,7 +38,7 @@ abstract class Encoding * * @param string $str * @return string - * @throws \TypeError + * @throws TypeError */ public static function base32Encode(string $str): string { @@ -48,7 +50,7 @@ abstract class Encoding * * @param string $str * @return string - * @throws \TypeError + * @throws TypeError */ public static function base32EncodeUpper(string $str): string { @@ -60,7 +62,7 @@ abstract class Encoding * * @param string $str * @return string - * @throws \TypeError + * @throws TypeError */ public static function base32Decode(string $str): string { @@ -72,7 +74,7 @@ abstract class Encoding * * @param string $str * @return string - * @throws \TypeError + * @throws TypeError */ public static function base32DecodeUpper(string $str): string { @@ -84,7 +86,7 @@ abstract class Encoding * * @param string $str * @return string - * @throws \TypeError + * @throws TypeError */ public static function base32HexEncode(string $str): string { @@ -96,7 +98,7 @@ abstract class Encoding * * @param string $str * @return string - * @throws \TypeError + * @throws TypeError */ public static function base32HexEncodeUpper(string $str): string { @@ -108,7 +110,7 @@ abstract class Encoding * * @param string $str * @return string - * @throws \TypeError + * @throws TypeError */ public static function base32HexDecode(string $str): string { @@ -120,7 +122,7 @@ abstract class Encoding * * @param string $str * @return string - * @throws \TypeError + * @throws TypeError */ public static function base32HexDecodeUpper(string $str): string { @@ -132,7 +134,7 @@ abstract class Encoding * * @param string $str * @return string - * @throws \TypeError + * @throws TypeError */ public static function base64Encode(string $str): string { @@ -144,7 +146,7 @@ abstract class Encoding * * @param string $str * @return string - * @throws \TypeError + * @throws TypeError */ public static function base64Decode(string $str): string { @@ -157,7 +159,7 @@ abstract class Encoding * Base64 character set "./[A-Z][a-z][0-9]" * @param string $str * @return string - * @throws \TypeError + * @throws TypeError */ public static function base64EncodeDotSlash(string $str): string { @@ -172,7 +174,7 @@ abstract class Encoding * @param string $str * @return string * @throws \RangeException - * @throws \TypeError + * @throws TypeError */ public static function base64DecodeDotSlash(string $str): string { @@ -185,7 +187,7 @@ abstract class Encoding * Base64 character set "[.-9][A-Z][a-z]" or "./[0-9][A-Z][a-z]" * @param string $str * @return string - * @throws \TypeError + * @throws TypeError */ public static function base64EncodeDotSlashOrdered(string $str): string { @@ -200,7 +202,7 @@ abstract class Encoding * @param string $str * @return string * @throws \RangeException - * @throws \TypeError + * @throws TypeError */ public static function base64DecodeDotSlashOrdered(string $str): string { @@ -213,7 +215,7 @@ abstract class Encoding * * @param string $bin_string (raw binary) * @return string - * @throws \TypeError + * @throws TypeError */ public static function hexEncode(string $bin_string): string { @@ -239,7 +241,7 @@ abstract class Encoding * * @param string $bin_string (raw binary) * @return string - * @throws \TypeError + * @throws TypeError */ public static function hexEncodeUpper(string $bin_string): string { diff --git a/vendor/paragonie/constant_time_encoding/src/Hex.php b/vendor/paragonie/constant_time_encoding/src/Hex.php index b1b05a098..a9e058cd3 100644 --- a/vendor/paragonie/constant_time_encoding/src/Hex.php +++ b/vendor/paragonie/constant_time_encoding/src/Hex.php @@ -2,8 +2,11 @@ declare(strict_types=1); namespace ParagonIE\ConstantTime; +use RangeException; +use TypeError; + /** - * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. + * Copyright (c) 2016 - 2022 Paragon Initiative Enterprises. * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -37,22 +40,19 @@ abstract class Hex implements EncoderInterface * * @param string $binString (raw binary) * @return string - * @throws \TypeError + * @throws TypeError */ public static function encode(string $binString): string { - /** @var string $hex */ $hex = ''; $len = Binary::safeStrlen($binString); for ($i = 0; $i < $len; ++$i) { /** @var array<int, int> $chunk */ - $chunk = \unpack('C', Binary::safeSubstr($binString, $i, 1)); - /** @var int $c */ + $chunk = \unpack('C', $binString[$i]); $c = $chunk[1] & 0xf; - /** @var int $b */ $b = $chunk[1] >> 4; - $hex .= pack( + $hex .= \pack( 'CC', (87 + $b + ((($b - 10) >> 8) & ~38)), (87 + $c + ((($c - 10) >> 8) & ~38)) @@ -67,24 +67,20 @@ abstract class Hex implements EncoderInterface * * @param string $binString (raw binary) * @return string - * @throws \TypeError + * @throws TypeError */ public static function encodeUpper(string $binString): string { - /** @var string $hex */ $hex = ''; - /** @var int $len */ $len = Binary::safeStrlen($binString); for ($i = 0; $i < $len; ++$i) { /** @var array<int, int> $chunk */ - $chunk = \unpack('C', Binary::safeSubstr($binString, $i, 2)); - /** @var int $c */ + $chunk = \unpack('C', $binString[$i]); $c = $chunk[1] & 0xf; - /** @var int $b */ $b = $chunk[1] >> 4; - $hex .= pack( + $hex .= \pack( 'CC', (55 + $b + ((($b - 10) >> 8) & ~6)), (55 + $c + ((($c - 10) >> 8) & ~6)) @@ -100,23 +96,20 @@ abstract class Hex implements EncoderInterface * @param string $encodedString * @param bool $strictPadding * @return string (raw binary) - * @throws \RangeException + * @throws RangeException */ - public static function decode(string $encodedString, bool $strictPadding = false): string - { - /** @var int $hex_pos */ + public static function decode( + string $encodedString, + bool $strictPadding = false + ): string { $hex_pos = 0; - /** @var string $bin */ $bin = ''; - /** @var int $c_acc */ $c_acc = 0; - /** @var int $hex_len */ $hex_len = Binary::safeStrlen($encodedString); - /** @var int $state */ $state = 0; if (($hex_len & 1) !== 0) { if ($strictPadding) { - throw new \RangeException( + throw new RangeException( 'Expected an even number of hexadecimal characters' ); } else { @@ -129,23 +122,17 @@ abstract class Hex implements EncoderInterface $chunk = \unpack('C*', $encodedString); while ($hex_pos < $hex_len) { ++$hex_pos; - /** @var int $c */ $c = $chunk[$hex_pos]; - /** @var int $c_num */ $c_num = $c ^ 48; - /** @var int $c_num0 */ $c_num0 = ($c_num - 10) >> 8; - /** @var int $c_alpha */ $c_alpha = ($c & ~32) - 55; - /** @var int $c_alpha0 */ $c_alpha0 = (($c_alpha - 10) ^ ($c_alpha - 16)) >> 8; if (($c_num0 | $c_alpha0) === 0) { - throw new \RangeException( + throw new RangeException( 'Expected hexadecimal character' ); } - /** @var int $c_val */ $c_val = ($c_num0 & $c_num) | ($c_alpha & $c_alpha0); if ($state === 0) { $c_acc = $c_val * 16; diff --git a/vendor/paragonie/constant_time_encoding/src/RFC4648.php b/vendor/paragonie/constant_time_encoding/src/RFC4648.php index 492cad00e..f124d65bf 100644 --- a/vendor/paragonie/constant_time_encoding/src/RFC4648.php +++ b/vendor/paragonie/constant_time_encoding/src/RFC4648.php @@ -2,8 +2,10 @@ declare(strict_types=1); namespace ParagonIE\ConstantTime; +use TypeError; + /** - * Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. + * Copyright (c) 2016 - 2022 Paragon Initiative Enterprises. * Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com) * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -41,7 +43,8 @@ abstract class RFC4648 * * @param string $str * @return string - * @throws \TypeError + * + * @throws TypeError */ public static function base64Encode(string $str): string { @@ -55,7 +58,8 @@ abstract class RFC4648 * * @param string $str * @return string - * @throws \TypeError + * + * @throws TypeError */ public static function base64Decode(string $str): string { @@ -69,7 +73,8 @@ abstract class RFC4648 * * @param string $str * @return string - * @throws \TypeError + * + * @throws TypeError */ public static function base64UrlSafeEncode(string $str): string { @@ -83,7 +88,8 @@ abstract class RFC4648 * * @param string $str * @return string - * @throws \TypeError + * + * @throws TypeError */ public static function base64UrlSafeDecode(string $str): string { @@ -97,7 +103,8 @@ abstract class RFC4648 * * @param string $str * @return string - * @throws \TypeError + * + * @throws TypeError */ public static function base32Encode(string $str): string { @@ -111,7 +118,8 @@ abstract class RFC4648 * * @param string $str * @return string - * @throws \TypeError + * + * @throws TypeError */ public static function base32Decode(string $str): string { @@ -125,7 +133,8 @@ abstract class RFC4648 * * @param string $str * @return string - * @throws \TypeError + * + * @throws TypeError */ public static function base32HexEncode(string $str): string { @@ -139,7 +148,8 @@ abstract class RFC4648 * * @param string $str * @return string - * @throws \TypeError + * + * @throws TypeError */ public static function base32HexDecode(string $str): string { @@ -153,7 +163,8 @@ abstract class RFC4648 * * @param string $str * @return string - * @throws \TypeError + * + * @throws TypeError */ public static function base16Encode(string $str): string { |