encode


Description:

public string encode (uchar[] data)

Encode a sequence of binary data into its Base-64 stringified representation.

Example: Base64, encode:

public static int main (string[] args) {
string encoded = Base64.encode ("hello, world!".data);
print ("Expected: aGVsbG8sIHdvcmxkIQ==\n");
print ("Got: %s\n", encoded);
return 0;
}

valac --pkg glib-2.0 GLib.Base64.encode.vala

Parameters:

data

the binary data to encode

len

the length of data

Returns:

a newly allocated, zero-terminated Base-64 encoded string representing data. The returned string must be freed with g_free.


Namespace: GLib.Base64
Package: glib-2.0