1
0

base64.h 453 B

12345678910111213141516171819
  1. #ifndef HV_BASE64_H_
  2. #define HV_BASE64_H_
  3. #include "hexport.h"
  4. #define BASE64_ENCODE_OUT_SIZE(s) (((s) + 2) / 3 * 4)
  5. #define BASE64_DECODE_OUT_SIZE(s) (((s)) / 4 * 3)
  6. BEGIN_EXTERN_C
  7. // @return encoded size
  8. HV_EXPORT int hv_base64_encode(const unsigned char *in, unsigned int inlen, char *out);
  9. // @return decoded size
  10. HV_EXPORT int hv_base64_decode(const char *in, unsigned int inlen, unsigned char *out);
  11. END_EXTERN_C
  12. #endif // HV_BASE64_H_