base64.h (1175B)
1 /********************************************************************* 2 * Filename: base64.h 3 * Author: Brad Conte (brad AT bradconte.com) 4 * Copyright: 5 * Disclaimer: This code is presented "as is" without any guarantees. 6 * Details: Defines the API for the corresponding Base64 implementation. 7 *********************************************************************/ 8 9 #ifndef BASE64_H 10 #define BASE64_H 11 12 /*************************** HEADER FILES ***************************/ 13 #include <stddef.h> 14 15 /**************************** DATA TYPES ****************************/ 16 typedef unsigned char BYTE; // 8-bit byte 17 18 /*********************** FUNCTION DECLARATIONS **********************/ 19 // Returns the size of the output. If called with out = NULL, will just return 20 // the size of what the output would have been (without a terminating NULL). 21 size_t base64_encode(const BYTE in[], BYTE out[], size_t len, int newline_flag); 22 23 // Returns the size of the output. If called with out = NULL, will just return 24 // the size of what the output would have been (without a terminating NULL). 25 size_t base64_decode(const BYTE in[], BYTE out[], size_t len); 26 27 #endif // BASE64_H