Javascript 将无符号字符数组转换为base64字符串

Javascript 将无符号字符数组转换为base64字符串,javascript,c++,activex,Javascript,C++,Activex,我有一个表示图像的无符号字符数组,我想在网页中显示它 我从ActiveX控件获取数组,我想用JavaScript在我的网页中显示它,所以我必须将它转换为“base64字符串”,所以我的问题是 如何在C++中转换无符号字符数组到Base64字符串? < P>苹果已经发布了一个开源的Base64编解码器。我记得曾经有一次在Windows项目上编译过它,没有任何问题。来源。标题 例如: unsigned char* array = <your data>; int len = <nu

我有一个表示图像的无符号字符数组,我想在网页中显示它

我从ActiveX控件获取数组,我想用JavaScript在我的网页中显示它,所以我必须将它转换为“base64字符串”,所以我的问题是


如何在C++中转换无符号字符数组到Base64字符串?

< P>苹果已经发布了一个开源的Base64编解码器。我记得曾经有一次在Windows项目上编译过它,没有任何问题。来源。标题

例如:

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
无符号字符*数组=;
整数长度=
int max_encoded_length=Base64encode_len(len);
char*encoded=新字符[最大编码长度];
int result=Base64encode(已编码,(常量字符*)数组,len);
//encoded现在是以null结尾的b64字符串
//“result”是字符串*的长度,包括*空终止符
//完成后不要忘记调用“delete[]encoded”

苹果发布了一款开源的Base64编码/解码器。我记得曾经有一次在Windows项目上编译过它,没有任何问题。来源。标题

例如:

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
无符号字符*数组=;
整数长度=
int max_encoded_length=Base64encode_len(len);
char*encoded=新字符[最大编码长度];
int result=Base64encode(已编码,(常量字符*)数组,len);
//encoded现在是以null结尾的b64字符串
//“result”是字符串*的长度,包括*空终止符
//完成后不要忘记调用“delete[]encoded”
退房退房