This function decodes a base64 encoded string (created using the buffer_base64_encode function) into a buffer.
Unlike the function buffer_base64_decode, this will not create a buffer for you, but rather you should already have created the buffer (see buffer_create), which you would then use with this function. The "offset" is the position within the buffer to decode the given string (in bytes).
buffer_base64_decode_ext(buffer, string, offset);
Argument | Type | Description |
---|---|---|
buffer | Buffer | The buffer to decode the string into. |
string | String | The base64 encoded string to decode. |
offset | Real | The data offset value. |
N/A
buff = buffer_create(16384, buffer_grow, 2);
ini_open("Save.ini");
var _str = ini_read_string("Save", "Slot1", "");
buffer_base64_decode_ext(buff, _str, 0);
ini_close();
The above code will create a buffer and store it in the variable buff, then open an INI file and read a string from it into the local variable _str. This string is then decoded into the newly created buffer before closing the INI file again.