函数char2Hex() - socketref,再见!高德 - C++博客
函数char2Hex()string Char2Hex(char a){ string str = ""; int n = a; for (int i=2*sizeof(char) - 1; i>=0; i--) { str += "0123456789ABCDEF"[((n >> i*4) & 0xF)]; } return str;}