Base64 Decode Base64 Encode CSS Beautifier Url Encoder Url Decoder Image to Base64 Base64 to Image

Ruby Base64.encode64()

Encode an input String using Base64.

Function

Base64.encode64(bin)

Parameters

bin - The String to be encoded

Return value

Returns the Base64-encoded version of bin. This method complies with RFC 2045. Line feeds are added to every 60 encoded charactors.

Example
require "base64"

string = 'base64 string'
encoded_string = Base64.encode64(string)
Github

https://github.com/base64encode/examples/blob/master/base64encode.rb

See also:
Ruby Base64.decode64