End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Base64#decode64
decode64(str)
lib/base64.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/base64.rb, line 58
def decode64(str)
str.unpack1("m")
end
Returns the Base64-decoded version of str. This method complies with RFC 2045. Characters outside the base alphabet are ignored.
Example
require 'base64' str = 'VGhpcyBpcyBsaW5lIG9uZQpUaGlzIG' + 'lzIGxpbmUgdHdvClRoaXMgaXMgbGlu' + 'ZSB0aHJlZQpBbmQgc28gb24uLi4K' puts Base64.decode64(str)
Generates:
Example
This is line one This is line two This is line three And so on...