Method: Base64#decode64
- Defined in:
- lib/base64.rb
#decode64(str) ⇒ Object (private)
Returns the Base64-decoded version of str.
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.unpack("m")[0] end |