Ruby Base64 Encoding and Decoding

As simple as the two methods below :)

class String
  def base64_decode
    unpack('m').first
  end
 
  def base64_encode
    [self].pack('m').chop
  end
end