public function base64Decode($data) { $decoded = str_pad($data, 4 - strlen($data) % 4, '='); return base64_decode(strtr($decoded, '-_', '+/')); }