Encode a section of a buffer using base64


GML Code Example

buffer_base64_encode(buffer, offset, size);

Argument Description
buffer The index of the buffer to use.
offset The data offset value.
size The size of the buffer.

Returns: String


This function will convert the data from the given buffer into a base64 format encoded string. This 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 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.


GML Code Example

var b_str = buffer_base64_encode(buff, 0, buffer_get_size(buff))

The above code will create encode the full data stored in the buffer indexed by the variable "buff", and store the returned string in the local variable "b_str".

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here