function EncryptString(str: string): string;
var
nI: Integer;
begin
Result:='';
for nI:=1 to Length(str) do
Result:=Result+IntToHex(Ord(str[nI]),2);
end;function DencryptString(str: string): string;
var
nI: Integer;
nB: Byte;
begin
Result:='';
nI:=1;
while (nI<=Length(str)) do
begin
if (str[nI]>='0') and (str[nI]<='9') then
nB:=Ord(str[nI])-$30
else
nB:=Ord(str[nI])-$37;
Inc(nI);
nB:=nB shl 4;
if (str[nI]>='0') and (str[nI]<='9') then
nB:=nB+Ord(str[nI])-$30
else
nB:=nB+Ord(str[nI])-$37;
Result:=Result+Chr(nB);
Inc(nI);
end;
var
nI: Integer;
begin
Result:='';
for nI:=1 to Length(str) do
Result:=Result+IntToHex(Ord(str[nI]),2);
end;function DencryptString(str: string): string;
var
nI: Integer;
nB: Byte;
begin
Result:='';
nI:=1;
while (nI<=Length(str)) do
begin
if (str[nI]>='0') and (str[nI]<='9') then
nB:=Ord(str[nI])-$30
else
nB:=Ord(str[nI])-$37;
Inc(nI);
nB:=nB shl 4;
if (str[nI]>='0') and (str[nI]<='9') then
nB:=nB+Ord(str[nI])-$30
else
nB:=nB+Ord(str[nI])-$37;
Result:=Result+Chr(nB);
Inc(nI);
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货