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.
Decode a Base64-encoded String
data64 |
|
result |
|
# File lib/sasl/base64.rb, line 28 def self.decode64(data64) data64.unpack('m').first end
Encode a String
data |
|
result |
|
# File lib/sasl/base64.rb, line 20 def self.encode64(data) [data].pack('m') end
Generated with the Darkfish Rdoc Generator 2.