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

See also: