Base64 (encoding/decoding)

The Base64 module is merely a convenience class that encapsulates the use of the 'btoa' and 'atob' native Javascript functions.

Base64 = {}
Base64.Encode = Base64Encode;
Base64.Decode = Base64Decode;

Encode

function Base64Encode( data )
{
	return btoa( data );
}

Decode

function Base64Decode( base64 )
{
	return atob( base64 );
}