29 #include <sys/types.h> 34 #endif // HAVE_CONFIG_H 42 int encode(
const unsigned char *src,
int len,
unsigned char *dst,
int buf_max)
44 int pos, s_pos, w_pos;
51 while (pos < len || s_pos >= 6)
55 dst[w_pos] = ((b >> 10) & 0x3f) + 0x40;
64 b |= src[pos] << (8 - s_pos);
86 int decode(
const unsigned char *src,
int len,
unsigned char *dst,
int buf_max)
88 unsigned short dat, b;
89 int pos, s_pos, w_pos;
104 dat |= (b << (10 - s_pos));
108 dst[w_pos] = (dat >> 8);
110 if (w_pos >= buf_max)
int decode(const unsigned char *src, int len, unsigned char *dst, int buf_max)
デコード
int encode(const unsigned char *src, int len, unsigned char *dst, int buf_max)
エンコード