Class: Dkim::Encodings::Base64

Inherits:
Object
  • Object
show all
Defined in:
lib/dkim/encodings/base64.rb

Instance Method Summary collapse

Instance Method Details

#decode(data) ⇒ Object



4
5
6
# File 'lib/dkim/encodings/base64.rb', line 4

def decode data
  data.gsub(/\s/, '').unpack('m0')[0]
end

#encode(data) ⇒ Object



7
8
9
# File 'lib/dkim/encodings/base64.rb', line 7

def encode data
  [data].pack('m0').gsub("\n", '')
end