Herzlich willkommen in der Delphi-PRAXiS, Enzo.
Vielleicht funktioniert es hiermit:
Delphi-Quellcode:
function CRC16(const s: String; const start, polynom: Word): Word;
var
w, i, j: Word;
b: Byte;
begin
Result := start;
for i := 1 to (2 + Length(S)) do begin
if i > Length(S)
then b := 0
else b := Ord(S[i]);
for J := 1 to 8 do begin
w := (b shr 7) xor (Result shr 15);
if (w = 1) then Result := Result xor polynom;
Result := (Result shl 1) or w;
b := b shl 1;
end;
end;
end;
Grüße vom marabu