16,749
社区成员
发帖
与我相关
我的任务
分享
function FcsTable(j: Cardinal): Cardinal;
var i: Integer;
begin
for i:=0 to 7 do
if Boolean(j and 1)then
j := (j shr 1)xor $8408
else
j := j shr 1;
Result := j;
end;
function Fcs16(cp: PByte; Len: Byte): Cardinal;
var i: Integer;
begin
Result := $ffff;
for i:=1 to Len do
begin
Result := (Result shr 8)xor((Result xor cp^)and $ff);
Inc(cp);
end;
Result := Result xor $ffff;
end;