Decode a base64 encoded string into a buffer at the given offset.


buffer_base64_decode_ext(buffer, string, offset);

Argument Description
buffer The index of the buffer to decode the string into.
string The base64 encoded string to decode.
offset The data offset value.

Returns: N/A


With this function you can decode 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), the id of which you would then use with this function. The "offset" is the position within the buffer to decode the given string (in bytes).


buff = buffer_create(16384, buffer_grow, 2);
var str = ini_read_string("Save", "Slot1", "");
buffer_base64_decode_ext(buff, str, 0);

The above code will create a buffer and store the unique id for 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.

Back: Buffers
Next: buffer_create
© Copyright YoYo Games Ltd. 2015 All Rights Reserved