L
longlybug
Unregistered / Unconfirmed
GUEST, unregistred user!
function Encode1(var s:String):String;
var
i,j,len:Integer;
cur:Integer;
t:String;
begin
Result:='';
len:=Length(s);
i:=1;j:=0;
while i<=len do
begin
if i<len then
cur:=(ord(s) shr j) or ((ord(s[i+1]) shl (7-j)) and $ff)
else
cur:=(ord(s) shr j) and $7f;
FmtStr(t,'%2.2x',[cur]);
Result:=Result+t;
inc(i);
j:=(j+1) mod 7;
if j=0 then inc(i);
end;
end;
var
i,j,len:Integer;
cur:Integer;
t:String;
begin
Result:='';
len:=Length(s);
i:=1;j:=0;
while i<=len do
begin
if i<len then
cur:=(ord(s) shr j) or ((ord(s[i+1]) shl (7-j)) and $ff)
else
cur:=(ord(s) shr j) and $7f;
FmtStr(t,'%2.2x',[cur]);
Result:=Result+t;
inc(i);
j:=(j+1) mod 7;
if j=0 then inc(i);
end;
end;