Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Set parameters of qChecksum
Forum Updated to NodeBB v4.3 + New Features

Set parameters of qChecksum

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 5.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moravas
    wrote on last edited by
    #1

    Hi Folks,

    I need to generate checksum for an array of data. Its stored in QByteArray, and as I googled, I found the qChecksum method, but I couldnot figure out, how should I set the parameters for CRC, like:

    • applied algorithm
    • seed
    • polinome
    • etc...

    can anybody explain me, how I can use this method, or is there any alternative Qt solution for CRC generation?

    Regards,
    Norbert

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hpollak
      wrote on last edited by
      #2

      There are no more Parameters to set in qChecksum see Documentation:

      quint16 qChecksum(const char * data, uint len)

      Returns the CRC-16 checksum of the first len bytes of data.

      The checksum is independent of the byte order (endianness).

      **Note: This function is a 16-bit cache conserving (16 entry table) implementation of the CRC-16-CCITT algorithm.
      **

      But maybe you can use QCryptographicHash Class

      Currently MD4, MD5, SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512 are supported.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        moravas
        wrote on last edited by
        #3

        Hi,

        I read the description of the method, but you can check for example this bug report:
        https://bugreports.qt.io/browse/QTBUG-8595

        In order to generate CRC, you need (you can set) to adjust more parameter as the input data.

        Regards,
        Norbert

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved