Solved Am I misunderstanding or misusing QByteArray::toHex()?
-
I have a
char[32] data;
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
data
is0x00
thenQByteArray(data)
will be empty (it assumes a null terminated string). Pass the size as a second parameter.