Calculate a Checksum
-
Hi, I would like to create a function to calculate a checksum for a arraydata. But I don't understand what I want for this checksum : " lower 8 bits of the sum from data1 to data10 equals to zero". My english is not perfect but I understand the sum of the data1 to data10 but equals to zero, I don't understand. Best regards youssef
-
Hi, I would like to create a function to calculate a checksum for a arraydata. But I don't understand what I want for this checksum : " lower 8 bits of the sum from data1 to data10 equals to zero". My english is not perfect but I understand the sum of the data1 to data10 but equals to zero, I don't understand. Best regards youssef
http://www.codeproject.com/cpp/checksum.asp --- Multitasking: Screwing up several things at once.
-
Hi, I would like to create a function to calculate a checksum for a arraydata. But I don't understand what I want for this checksum : " lower 8 bits of the sum from data1 to data10 equals to zero". My english is not perfect but I understand the sum of the data1 to data10 but equals to zero, I don't understand. Best regards youssef
Perhaps, BYTE checksum = 0; for ( int i = 0; i < 10; i++ ) { checksum += (BYTE)( data[ i ] ); } if ( checksum == 0 ) { good checksum } else { bad checksum } This means that one of your array values is a checksum value which makes the whole array add up to zero. PS: No one's English is perfect!