Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Am I misunderstanding or misusing QByteArray::toHex()?
In Fo last edited by
I have a
populated with some data and its bytes increment from 0x00 to 0xff one after another over the course of the algorithm. When I call
auto hex = QByteArray(data).toHex();
every time hex contains an empty array regardless of the increments of data bytes.
What's the trick?
If first element in
QByteArray(data)will be empty (it assumes a null terminated string). Pass the size as a second parameter.