Base64 Decode Base64 Encode
More Tools
Other tools: Base64 Image Encoder | Base64 Image Decoder | Url Encoder | Url Decoder

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