Results 1 to 2 of 2

Thread: How to convert string hex values to its real binary values?

  1. #1
    Join Date
    May 2011
    Location
    Transylvania
    Posts
    7
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Exclamation How to convert string hex values to its real binary values?

    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!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to convert string hex values to its real binary values?


Similar Threads

  1. Get Co-ordinates Values
    By amitpatel22 in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2011, 11:12
  2. Replies: 6
    Last Post: 10th October 2010, 23:15
  3. Replies: 2
    Last Post: 10th December 2009, 20:51
  4. How to read and get the values out of the xml?
    By dark1988 in forum Qt Programming
    Replies: 1
    Last Post: 26th July 2008, 00:29
  5. convert string to byte values
    By steg90 in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2007, 14:06

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.