Im working on automotive controller and I have following question

I have list(about 6) of 32 bit CRCs and I want to combine them to get a resultant one can I 'OR' or 'XOR' them to get resultant one?

Have gone through CRC32(a,b) function but could not understand its definition or how it is combining two CRCs. Is it combining the normal way of finding CRC of a number?

Suggestions will be helpful .Thanks in prior.

  • \$\begingroup\$ If you OR 6 of them you are quite likely to get "11111111111111111111111111111111". XOR would be a better choice, or run them all through CRC32, but there may be better ones still, depending on your purpose which we don't know. \$\endgroup\$ – Brian Drummond Sep 7 at 12:43
  • 1
    \$\begingroup\$ It's not clear why you want to do all this, for which purpose? What you write makes little sense, anyways. \$\endgroup\$ – Marcus Müller Sep 7 at 13:06
  • \$\begingroup\$ You need to learn a lot more about CRC, more than we can provide here. -- Having said that, you should not "combine" CRCs in a result of the same width. You will lose the main purpose of CRC: The low probability that something in your data changed without notice. Your best bet is to choose "a good one" (TM). You might also consider to concatenate CRCs giving a wider result. \$\endgroup\$ – the busybee Sep 8 at 10:15
  • \$\begingroup\$ The theory behind all this is bitwise XOR. (The reason why CRC is always at the end and always Big Endian is that you can implement the algorithm in hardware with XOR gates.) From what I remember, "A painless guide to CRC" explains the theory behind it all quite well. \$\endgroup\$ – Lundin Sep 8 at 10:15
  • \$\begingroup\$ Thanks everyone for your precious time and helping me get hints \$\endgroup\$ – MicroUncontroller Sep 9 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.