buffer_base64_encode

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.

 

Syntax:

buffer_base64_encode(buffer, offset, size);

ArgumentTypeDescription
bufferBufferThe buffer to use.
offsetRealThe data offset value.
sizeRealThe size of the buffer.

 

Returns:

String

 

Example:

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.