PHP 8.3.31
Preview: Base64Encoder.php Size: 1.25 KB
/home/getspomw/royalsquad.us/vendor/symfony/mime/Encoder/Base64Encoder.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Mime\Encoder;

/**
 * @author Chris Corbyn
 */
class Base64Encoder implements EncoderInterface
{
    /**
     * Takes an unencoded string and produces a Base64 encoded string from it.
     *
     * Base64 encoded strings have a maximum line length of 76 characters.
     * If the first line needs to be shorter, indicate the difference with
     * $firstLineOffset.
     */
    public function encodeString(string $string, ?string $charset = 'utf-8', int $firstLineOffset = 0, int $maxLineLength = 0): string
    {
        if (0 >= $maxLineLength || 76 < $maxLineLength) {
            $maxLineLength = 76;
        }

        $encodedString = base64_encode($string);
        $firstLine = '';
        if (0 !== $firstLineOffset) {
            $firstLine = substr($encodedString, 0, $maxLineLength - $firstLineOffset)."\r\n";
            $encodedString = substr($encodedString, $maxLineLength - $firstLineOffset);
        }

        return $firstLine.trim(chunk_split($encodedString, $maxLineLength, "\r\n"));
    }
}

Directory Contents

Dirs: 0 × Files: 14

Name Size Perms Modified Actions
689 B lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
1.30 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
1.25 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
1.26 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
668 B lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
834 B lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
717 B lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
10.01 KB lrw-r--r-- 2026-04-26 08:36:12
Edit Download
1.28 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
467 B lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
1.69 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
7.67 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
1.05 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
1.40 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).