Method: Base64.decode64

Defined in:
lib/base64.rb

.decode64(str) ⇒ Object

Returns the Base64-decoded version of str. This method complies with RFC 2045. Characters outside the base alphabet are ignored.

require 'base64'
str = 'VGhpcyBpcyBsaW5lIG9uZQpUaGlzIG' +
      'lzIGxpbmUgdHdvClRoaXMgaXMgbGlu' +
      'ZSB0aHJlZQpBbmQgc28gb24uLi4K'
puts Base64.decode64(str)

Generates:

This is line one
This is line two
This is line three
And so on...


58
59
60
# File 'lib/base64.rb', line 58

def decode64(str)
  str.unpack1("m")
end