mimekit-ts - v1.0.0
    Preparing search index...

    Class Base64Encoder

    Incrementally encodes content using the base64 encoding.

    Base64 is often used in MIME to encode binary content such as images and other multimedia so that data remains intact over 7-bit transports such as SMTP.

    Implements

    Index
    • Creates a new base64 encoder.

      Values over 76 octets are capped at 76 unless line length limits are explicitly overridden.

      Parameters

      • maxLineLength: number = 76

        The maximum number of octets per line, not counting the line break.

      • overrideMaxLineLengthLimits: boolean = false

        Whether to bypass the normal MIME line-length limits.

      Returns Base64Encoder

      maxLineLength is outside the supported range.

    • Encodes the specified input into the output buffer.

      The output buffer should be large enough to hold all encoded input. Use estimateOutputLength to estimate the required size.

      Parameters

      • input: Uint8Array

        The input buffer.

      • startIndex: number

        The starting index of the input buffer.

      • length: number

        The length of the input range.

      • output: Uint8Array

        The output buffer.

      Returns number

      The number of bytes written to the output buffer.

      The input range is invalid or the output buffer is too small.

    • Encodes the specified input into the output buffer and flushes internal state.

      Parameters

      • input: Uint8Array

        The input buffer.

      • startIndex: number

        The starting index of the input buffer.

      • length: number

        The length of the input range.

      • output: Uint8Array

        The output buffer.

      Returns number

      The number of bytes written to the output buffer.

      The input range is invalid or the output buffer is too small.