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 504B

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