MCPcopy Create free account
hub / github.com/dannagle/PacketSender / byteArrayToHex

Method byteArrayToHex

src/packet.cpp:508–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508QString Packet::byteArrayToHex(QByteArray data)
509{
510 QString byte, returnString, returnStringTemp;
511 // QDEBUG() << "size is " <<data.size();
512
513 if (data.isEmpty()) {
514 return "";
515 }
516
517 int datasize = data.size();
518
519 returnStringTemp = data.toHex().toUpper();
520 returnString.resize(datasize * 3, ' ');
521
522 int j = 0;
523 for (int i = 0; i < returnStringTemp.size(); i += 2) {
524 returnString[j] = returnStringTemp[i];
525 returnString[j + 1] = returnStringTemp[i + 1];
526 j += 3;
527 }
528
529 return returnString;
530
531}
532
533int Packet::hexToInt(QChar hex)
534{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected