#include <string>
std::string bytestohexstring(char* bytes, int bytelength)
{
std::string str("");
std::string str2("0123456789abcdef");
for (int i = 0; i < bytelength; i++) {
int b;
b = 0x0f & (bytes[i] >> 4);
char s1 = str2.at(b);
str.append(1, str2.at(b));
b = 0x0f & bytes[i];
str.append(1, str2.at(b));
char s2 = str2.at(b);
}
return str;
}
十六进制数组转字符串
于 2023-03-15 11:25:25 首次发布