here is a simple function I use:
 

function CalcCheckSum(const S: String): Word;
var
  i: Integer;
begin
  result := 0;
  for i := 1 to Length(S) do
    result := result xor Word(S[i]);
end

probably not the fastest, but it's adequate.

Cheers,

Phil.

----- Original Message -----
Sent: Thursday, November 11, 2004 4:12 PM
Subject: [DUG] �exclusive or�

Hi all.

I am not too good a this stuff, but I have to pass a checksum at the end of a bit of data, and the documentation says "the checksum Is calculated by �exclusive or� among all sent characters"

How would I do this?

 

Jeremy


_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to