This function converts the data in the given buffer into a base64 encoded string.
Base64 is a commonly used encoding scheme that is often used for any media that needs to be stored or transferred over the internet as text, and renders the output unreadable to the human eye.
To use this function you need to specify an already created buffer, the offset value (which is the point within the buffer at which you wish to start encoding) as well as the size, in bytes, of the buffer memory to encode.
buffer_base64_encode(buffer, offset, size);
Argument | Type | Description |
---|---|---|
buffer | Buffer | The buffer to use. |
offset | Real | The data offset value. |
size | Real | The size of the buffer. |
var _b_str = buffer_base64_encode(buff, 0, buffer_get_size(buff));
The above code encodes the full data stored in the buffer stored in the variable buff and stores the returned string in a local variable _b_str.