1
0

base64.h 437 B

123456789101112131415161718
  1. #ifndef HV_BASE64_H_
  2. #define HV_BASE64_H_
  3. #include "hexport.h"
  4. enum {BASE64_OK = 0, BASE64_INVALID};
  5. #define BASE64_ENCODE_OUT_SIZE(s) (((s) + 2) / 3 * 4)
  6. #define BASE64_DECODE_OUT_SIZE(s) (((s)) / 4 * 3)
  7. BEGIN_EXTERN_C
  8. HV_EXPORT int base64_encode(const unsigned char *in, unsigned int inlen, char *out);
  9. HV_EXPORT int base64_decode(const char *in, unsigned int inlen, unsigned char *out);
  10. END_EXTERN_C
  11. #endif // HV_BASE64_H_