class Mail::Encodings::Base64
Base64
encoding handles binary content at the cost of 4 output bytes per input byte.
Constants
- NAME
- PRIORITY
Public Class Methods
can_encode?(enc)
click to toggle source
# File lib/mail/encodings/base64.rb, line 14 def self.can_encode?(enc) true end
compatible_input?(str)
click to toggle source
cost(str)
click to toggle source
3 bytes in -> 4 bytes out
# File lib/mail/encodings/base64.rb, line 27 def self.cost(str) 4.0 / 3 end
decode(str)
click to toggle source
# File lib/mail/encodings/base64.rb, line 18 def self.decode(str) Utilities.decode_base64(str) end
encode(str)
click to toggle source
# File lib/mail/encodings/base64.rb, line 22 def self.encode(str) ::Mail::Utilities.binary_unsafe_to_crlf(Utilities.encode_base64(str)) end