Last change
on this file was
e16e8f2,
checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago
|
bootstuff
|
-
Property mode set to
100644
|
File size:
504 bytes
|
Rev | Line | |
---|
[e16e8f2] | 1 | #ifndef _GPXE_BASE64_H |
---|
| 2 | #define _GPXE_BASE64_H |
---|
| 3 | |
---|
| 4 | /** @file |
---|
| 5 | * |
---|
| 6 | * Base64 encoding |
---|
| 7 | * |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | FILE_LICENCE ( GPL2_OR_LATER ); |
---|
| 11 | |
---|
| 12 | #include <stdint.h> |
---|
| 13 | |
---|
| 14 | /** |
---|
| 15 | * Calculate length of base64-encoded string |
---|
| 16 | * |
---|
| 17 | * @v raw_len Raw string length (excluding NUL) |
---|
| 18 | * @ret encoded_len Encoded string length (excluding NUL) |
---|
| 19 | */ |
---|
| 20 | static inline size_t base64_encoded_len ( size_t raw_len ) { |
---|
| 21 | return ( ( ( raw_len + 3 - 1 ) / 3 ) * 4 ); |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | extern void base64_encode ( const char *raw, char *encoded ); |
---|
| 25 | |
---|
| 26 | #endif /* _GPXE_BASE64_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.