Hello,
I have a char* string that I have encoded using AES encryption. This string contains a wide range of hex characters, not just those viewable by ASCII. I need to convert this string so I can send it through HTTP, which does not accept all of the characters generated by the encryption algorithm.
What is the best way to convert this string? I have used the following function but there are a lot of blanks (0xFF), it cant convert all of the characters.
char *strToHex(char *str){
char *buffer = new char[(dStrlen(str)*2)+1];
char *pbuffer = buffer;
int len = strlen( str );
for(int i = 0; i < len ; ++i ){
sprintf(pbuffer, "%02X", str[i]);
pbuffer += 2;
}
return buffer;
}
Thank you, Justin