|
-
March 10th, 2003, 03:55 AM
#1
Checksum
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|