Encode a section of a buffer using base64


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.


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".

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