Hello!

I have a 8-char-string for which I have to do a checksum. Which would be the best way to do it? I thought of a kind of a weighted sum like:

sum = char[0]*1+char[1]*2+char[2]*3+char[3]*4+char[4]*5+char[5]*6+char[6]*7+char[7]*8 % 255;

But this could not alarm if (for example):
char[0]: Original: 0 Fault transmitted: 2
char[1]: Original: 2 Fault transmitted: 0

Is there a better way?