字节转十六进制字符串
string bytesToHexString(const char* bytes, int len) {
  string result = "";
  string temp = "0123456789ABCDEF";
  int index = 0;
  for (int i = 0; i < len; i++) {
    index = (bytes[i] >> 4) & 0x0f;
    result.append(1, temp.at(index));  // Append a character at the end of the string.
    index = bytes[i] & 0x0f;
    result.append(1, temp.at(index));
  }
  return result;
}
 
                    
                
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号