AppleはオープンソースのBase64エンコード/デコーダーを公開しています。私はこのプロジェクトをWindowsプロジェクトで一度も問題なくコンパイルしたことを思い出します。ソースhere。ヘッダーhere。例えば
:
unsigned char* array = <your data>;
int len = <number of bytes in "array">
int max_encoded_length = Base64encode_len(len);
char* encoded = new char[max_encoded_length];
int result = Base64encode(encoded, (const char *)array, len);
// encoded is now a null terminated b64 string
// "result" is the length of the string *including* the null terminator
// don't forget to invoke "delete [] encoded" when done
チェックアウトhttp://stackoverflow.com/questions/342409/how-do-i-base64-encode-decode-in-c – pSoLT