decode


Description:

[ CCode ( array_length_type = "gsize" ) ]
public uchar[] decode (string text)

Decode a sequence of Base-64 encoded text into binary data.

Note that the returned binary data is not necessarily zero-terminated, so it should not be used as a character string.

Example: Base64, decode:

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

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

Parameters:

text

zero-terminated string with base64 text to decode

out_len

The length of the decoded data is written here

Returns:

newly allocated buffer containing the binary data that text represents. The returned buffer must be freed with g_free.


Namespace: GLib.Base64
Package: glib-2.0