PDA

View Full Version : How to convert string hex values to its real binary values?



AttilaPethe
20th February 2012, 22:37
How can I convert in an elegant way a loooong hex string data from its hex representation to the real (binary) representation?

I have this:
QByteArray *inputdata = new QByteArray ("020707010001030103030700090508003520080480183500"); (only hex numbers in the string)
And I want to have a pointer to this in memory, like: 0x020707010001030103030700090508003520080480183500

I want to feed the inputdata to the QCryptographicHash but in this case I feed the QCryptographicHash with the asci representation of 02070701000103010303070009...
what is: 3032303730373031303030313033303130333......

Please notice that in this case we can not use toLong or toInt methods!

Thanks for any idea!

ChrisW67
20th February 2012, 22:47
QByteArray::fromHex()