Lines Matching refs:src
51 * @param string $src
55 public static function decodeUpper(string $src, bool $strictPadding = false): string argument
57 return static::doDecode($src, true, $strictPadding);
74 * @param string $src
78 public static function encodeUnpadded(string $src): string argument
80 return static::doEncode($src, false, false);
86 * @param string $src
90 public static function encodeUpper(string $src): string argument
92 return static::doEncode($src, true, true);
98 * @param string $src
102 public static function encodeUpperUnpadded(string $src): string argument
104 return static::doEncode($src, true, false);
111 * @param int $src
114 protected static function decode5Bits(int $src): int argument
119 $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 96);
122 $ret += (((0x31 - $src) & ($src - 0x38)) >> 8) & ($src - 23);
133 * @param int $src
136 protected static function decode5BitsUpper(int $src): int argument
141 $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64);
144 $ret += (((0x31 - $src) & ($src - 0x38)) >> 8) & ($src - 23);
153 * @param int $src
156 protected static function encode5Bits(int $src): string argument
161 $diff -= ((25 - $src) >> 8) & 73;
163 return \pack('C', $src + $diff);
172 * @param int $src
175 protected static function encode5BitsUpper(int $src): string argument
180 $diff -= ((25 - $src) >> 8) & 41;
182 return \pack('C', $src + $diff);
189 * @param string $src
196 …protected static function doDecode(string $src, bool $upper = false, bool $strictPadding = false):… argument
204 $srcLen = Binary::safeStrlen($src);
211 if ($src[$srcLen - 1] === '=') {
224 $src = \rtrim($src, '=');
225 $srcLen = Binary::safeStrlen($src);
233 $chunk = \unpack('C*', Binary::safeSubstr($src, $i, 8));
264 $chunk = \unpack('C*', Binary::safeSubstr($src, $i, $srcLen - $i));
382 * @param string $src
388 protected static function doEncode(string $src, bool $upper = false, $pad = true): string argument
396 $srcLen = Binary::safeStrlen($src);
401 $chunk = \unpack('C*', Binary::safeSubstr($src, $i, 5));
420 $chunk = \unpack('C*', Binary::safeSubstr($src, $i, $srcLen - $i));