base64.h

Go to the documentation of this file.
00001 #ifndef _GPXE_BASE64_H
00002 #define _GPXE_BASE64_H
00003 
00004 /** @file
00005  *
00006  * Base64 encoding
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER );
00011 
00012 #include <stdint.h>
00013 
00014 /**
00015  * Calculate length of base64-encoded string
00016  *
00017  * @v raw_len           Raw string length (excluding NUL)
00018  * @ret encoded_len     Encoded string length (excluding NUL)
00019  */
00020 static inline size_t base64_encoded_len ( size_t raw_len ) {
00021         return ( ( ( raw_len + 3 - 1 ) / 3 ) * 4 );
00022 }
00023 
00024 extern void base64_encode ( const char *raw, char *encoded );
00025 
00026 #endif /* _GPXE_BASE64_H */

Generated on Tue Apr 6 20:01:06 2010 for gPXE by  doxygen 1.5.7.1