MySQL  8.0.26
Source Code Documentation
base64.h File Reference
#include <stddef.h>
#include "my_inttypes.h"

Go to the source code of this file.

Macros

#define MY_BASE64_DECODE_ALLOW_MULTIPLE_CHUNKS   1
 

Functions

uint64 base64_needed_encoded_length (uint64 length_of_data)
 
uint64 base64_encode_max_arg_length (void)
 Maximum length base64_needed_encoded_length() can handle without overflow. More...
 
uint64 base64_needed_decoded_length (uint64 length_of_encoded_data)
 
uint64 base64_decode_max_arg_length ()
 Maximum length base64_needed_decoded_length() can handle without overflow. More...
 
int base64_encode (const void *src, size_t src_len, char *dst)
 
int64 base64_decode (const char *src, size_t src_len, void *dst, const char **end_ptr, int flags)
 Decode a base64 string The base64-encoded data in the range ['src','*end_ptr') will be decoded and stored starting at 'dst'. More...
 

Macro Definition Documentation

◆ MY_BASE64_DECODE_ALLOW_MULTIPLE_CHUNKS

#define MY_BASE64_DECODE_ALLOW_MULTIPLE_CHUNKS   1

Function Documentation

◆ base64_decode()

int64 base64_decode ( const char *  src_base,
size_t  len,
void *  dst,
const char **  end_ptr,
int  flags 
)

Decode a base64 string The base64-encoded data in the range ['src','*end_ptr') will be decoded and stored starting at 'dst'.

The decoding will stop after 'len' characters have been read from 'src', or when padding occurs in the base64-encoded data. In either case: if 'end_ptr' is non-null, '*end_ptr' will be set to point to the character after the last read character, even in the presence of error.

Note: We require that 'dst' is pre-allocated to correct size.

Parameters
src_basePointer to base64-encoded string
lenLength of string at 'src'
dstPointer to location where decoded data will be stored
end_ptrPointer to variable that will refer to the character after the end of the encoded data that were decoded. Can be NULL.
flagsflags e.g. allow multiple chunks
Returns
Number of bytes written at 'dst', or -1 in case of failure

◆ base64_decode_max_arg_length()

uint64 base64_decode_max_arg_length ( )

Maximum length base64_needed_decoded_length() can handle without overflow.

◆ base64_encode()

int base64_encode ( const void *  src,
size_t  src_len,
char *  dst 
)

◆ base64_encode_max_arg_length()

uint64 base64_encode_max_arg_length ( void  )

Maximum length base64_needed_encoded_length() can handle without overflow.

◆ base64_needed_decoded_length()

uint64 base64_needed_decoded_length ( uint64  length_of_encoded_data)

◆ base64_needed_encoded_length()

uint64 base64_needed_encoded_length ( uint64  length_of_data)