Sha256: a767959fb89ea8c1c670708e467758824d53cc2d3f1570ff615528a932b71fd5

Contents?: true

Size: 762 Bytes

Versions: 39

Compression:

Stored size: 762 Bytes

Contents

# =XMPP4R - XMPP Library for Ruby
# License:: Ruby's license (see the LICENSE file) or GNU GPL, at your option.
# Website::http://home.gna.org/xmpp4r/

begin
  require 'base64'
rescue LoadError
  ##
  # Ruby 1.9 has dropped the Base64 module,
  # this is a replacement
  #
  # We could replace all call by Array#pack('m')
  # and String#unpack('m'), but this module
  # improves readability.
  module Base64
    ##
    # Encode a String
    # data:: [String] Binary
    # result:: [String] Binary in Base64
    def self.encode64(data)
      [data].pack('m')
    end

    ##
    # Decode a Base64-encoded String
    # data64:: [String] Binary in Base64
    # result:: [String] Binary
    def self.decode64(data64)
      data64.unpack('m').first
    end
  end
end

Version data entries

39 entries across 39 versions & 17 rubygems

Version Path
kiro-ruby-sasl-0.0.4.0 lib/sasl/base64.rb
astro-ruby-sasl-0.0.2 lib/sasl/base64.rb
astro-ruby-sasl-0.0.3 lib/sasl/base64.rb
brontes3d-xmpp4r-0.4 lib/xmpp4r/base64.rb
bryanl-xmpp4r-0.3.2 lib/xmpp4r/base64.rb
edavey-xmpp4r-0.4.1 lib/xmpp4r/base64.rb
edavey-xmpp4r-0.4.2 lib/xmpp4r/base64.rb
edavey-xmpp4r-0.4 lib/xmpp4r/base64.rb
heipei-xmpp4r-0.3.2 lib/xmpp4r/base64.rb
ln-xmpp4r-0.5 lib/xmpp4r/base64.rb
mojodna-xmpp4r-0.4.0.2 lib/xmpp4r/base64.rb
mojodna-xmpp4r-0.4.0.3 lib/xmpp4r/base64.rb
seanohalpin-xmpp4r-0.4.1 lib/xmpp4r/base64.rb
xmpp4r-0.5.5 lib/xmpp4r/base64.rb
gmcmillan-xmpp4r-0.6.2 lib/xmpp4r/base64.rb
gmcmillan-xmpp4r-0.6.1 lib/xmpp4r/base64.rb
gmcmillan-xmpp4r-0.6 lib/xmpp4r/base64.rb
gmcmillan-xmpp4r-0.5 lib/xmpp4r/base64.rb
mad-p-xmpp4r-0.6.3 lib/xmpp4r/base64.rb
mad-p-xmpp4r-0.6.2 lib/xmpp4r/base64.rb