Hi all

I need to calculate CRC for my file..The algorithm is CRC-16..
I have a binary file with me.. I have also calculated checksum for the whole file . Now my doubt is for calculating checksum for any file do we need to calculate CRC for each and every data byte or is it just enough to do manipulations on the checksum of the whole file???


Thanks in advance

CRC-16 is a type of checksum.
So what are you doing that needs to be checksumed twice?
[Edit]
More correctly, both are methods of detecting errors in data.
Either you do a sum check or you do a CRC.
You should not need both.

To answer the last question, you need to do it on every byte of the file.

So should we calculate CRC for separate bytes that is present in my binary file ???

No, the CRC is computed on all the bytes. I uses a formula to combine them all and generate a new value.

Can you tel me how to select a polynomial for performing CRC???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.