# class Mail::Encodings::Base64

### Constants

NAME
PRIORITY

### Public Class Methods

can_encode?(enc) click to toggle source

    # File lib/mail/encodings/base64.rb, line 10
    def self.can_encode?(enc)
      true
    end

compatible_input?(str) click to toggle source

Base64 inserts newlines automatically and cannot violate the SMTP spec.

    # File lib/mail/encodings/base64.rb, line 30
    def self.compatible_input?(str)
      true
    end

cost(str) click to toggle source

Base64 has a fixed cost, 4 bytes out per 3 bytes in

    # File lib/mail/encodings/base64.rb, line 25
    def self.cost(str)
      4.0/3
    end

decode(str) click to toggle source

Decode the string from Base64

    # File lib/mail/encodings/base64.rb, line 15
    def self.decode(str)
      RubyVer.decode_base64( str )
    end

encode(str) click to toggle source

Encode the string to Base64

    # File lib/mail/encodings/base64.rb, line 20
    def self.encode(str)
      ::Mail::Utilities.to_crlf(RubyVer.encode_base64( str ))
    end