1 #ifndef _LIBRETRO_ENCODINGS_BASE64_H 2 #define _LIBRETRO_ENCODINGS_BASE64_H 3 4 #include <stdint.h> 5 #include <stddef.h> 6 7 #include <retro_common_api.h> 8 9 RETRO_BEGIN_DECLS 10 11 const static char* b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 12 13 /* maps A=>0,B=>1.. */ 14 const static unsigned char unb64[]={ 15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19 0, 0, 0, 62, 0, 0, 0, 63, 52, 53, 20 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 21 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 22 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 23 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 24 25, 0, 0, 0, 0, 0, 0, 26, 27, 28, 25 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 26 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 27 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 28 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40 0, 0, 0, 0, 0, 0, 41 }; /* This array has 256 elements */ 42 43 char* base64(const void* binaryData, int len, int *flen); 44 unsigned char* unbase64(const char* ascii, int len, int *flen); 45 46 RETRO_END_DECLS 47 48 #endif 49