You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

base64.h 471B

123456789101112131415161718192021222324
  1. #ifndef _GPXE_BASE64_H
  2. #define _GPXE_BASE64_H
  3. /** @file
  4. *
  5. * Base64 encoding
  6. *
  7. */
  8. #include <stdint.h>
  9. /**
  10. * Calculate length of base64-encoded string
  11. *
  12. * @v raw_len Raw string length (excluding NUL)
  13. * @ret encoded_len Encoded string length (excluding NUL)
  14. */
  15. static inline size_t base64_encoded_len ( size_t raw_len ) {
  16. return ( ( ( raw_len + 3 - 1 ) / 3 ) * 4 );
  17. }
  18. extern void base64_encode ( const char *raw, char *encoded );
  19. #endif /* _GPXE_BASE64_H */