function CRC16(Data: string): string;
var
I, Len, CRC: Word;
pData: PChar;
begin
CRC := 0;
Len := Length(Data);
pData := PChar(Data);
while Len > 0 do
begin
CRC := CRC xor (Word(pData^) shl 8);
Inc(pData);
I := 8;
repeat
if CRC and $8000 > 0 then
CRC := (CRC shl 1) xor $1021
else
CRC := CRC shl 1;
Dec(I);
until I = 0;
Dec(Len);
end;
Result := IntToHex(CRC, 4);
end;
function CRC16(Data: string): string;var I, Len, CRC: Word; pData: PChar;begin CRC := 0; Len := Length(Data); pData := PChar(Data); while Len > 0 do begin CRC := CRC xor (Word(pDa