function HexToAscii(s: string): string; var i: integer; begin Result := EmptyStr; for i := 1 to Length(S) do begin if ((i mod 2) = 1) then Result := Result + Chr(StrToInt('0x' + Copy(S, i, 2))); end; end;
function StrToBin(const s: string):String; var i,len: integer; begin Result:=''; len:=Length(s) div 2; if len=0 then exit; SetLength(Result,len); for i:=1 to len do Result[i]:=chr(ord(s[2*i-1])*10+ord(s[2*i])); end;
var
i: integer;
begin
Result := EmptyStr;
for i := 1 to Length(S) do
begin
if ((i mod 2) = 1) then
Result := Result + Chr(StrToInt('0x' + Copy(S, i, 2)));
end;
end;
var
i,len: integer;
begin
Result:='';
len:=Length(s) div 2;
if len=0 then
exit;
SetLength(Result,len);
for i:=1 to len do
Result[i]:=chr(ord(s[2*i-1])*10+ord(s[2*i]));
end;