Results 1 to 2 of 2

Thread: How to concatenate boost crc16 checksum ?

  1. #1
    Join Date
    Mar 2014
    Posts
    12
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default How to concatenate boost crc16 checksum ?

    Good Day.
    I transfer a packet by chunks and use boost library for computing crc (16 bits) of packet.
    I obtain other checksums for whole byte's array and concatenation by chunks.
    For example:
    step1 (transfer of first chunk)
    Qt Code:
    1. boost::crc_16_type crcobject;
    2. ...
    3. memcpy(ba_tosocket->data()+offset,(char *)&bin_tosocket[0],headersize);
    4. crcobject.reset(0);
    5. crcobject.process_bytes(ba_tosocket->data(),headersize);
    6. bin_tosocket[3] = crcobject.checksum();
    To copy to clipboard, switch view to plain text mode 
    step2 (transfer of second chunk)
    Qt Code:
    1. memcpy(ba_tosocket->data()+offset,batmp.data(),dataframesize);
    2. crcobject.reset(bin_tosocket[3]);
    3. crcobject.process_bytes(ba_tosocket->data(),dataframesize);
    4. bin_tosocket[3] = crcobject.checksum();
    To copy to clipboard, switch view to plain text mode 
    First and second chunks were aligned on word's margin (16 bits).
    Is it right approach for concatenation of CRCs ?
    Last edited by Pechkin; 3rd July 2014 at 15:23.
    Best regards.

  2. #2
    Join Date
    Mar 2014
    Posts
    12
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: How to concatenate boost crc16 checksum ?

    Thank's for attention.
    The problem is solved.
    Best regards.

Similar Threads

  1. how to concatenate a variable with a string
    By doforumda in forum Newbie
    Replies: 1
    Last Post: 25th August 2010, 08:34
  2. concatenate two values
    By rk0747 in forum Qt Programming
    Replies: 4
    Last Post: 30th May 2010, 10:43
  3. crc checksum
    By kodiak in forum Qt Programming
    Replies: 1
    Last Post: 19th April 2008, 09:27
  4. Concatenate two array elements
    By b1 in forum General Programming
    Replies: 6
    Last Post: 29th October 2007, 20:43
  5. how to concatenate .wav files with different frequencies
    By BOMMACANTI in forum Qt Programming
    Replies: 1
    Last Post: 28th May 2006, 13:51

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.