david/ipxe
Archived
1
0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src/include/gpxe/base64.h
2009-02-13 14:54:13 +00:00

25 lines
471 B
C

#ifndef _GPXE_BASE64_H
#define _GPXE_BASE64_H
/** @file
*
* Base64 encoding
*
*/
#include <stdint.h>
/**
* Calculate length of base64-encoded string
*
* @v raw_len Raw string length (excluding NUL)
* @ret encoded_len Encoded string length (excluding NUL)
*/
static inline size_t base64_encoded_len ( size_t raw_len ) {
return ( ( ( raw_len + 3 - 1 ) / 3 ) * 4 );
}
extern void base64_encode ( const char *raw, char *encoded );
#endif /* _GPXE_BASE64_H */