function StrToHex32(const SrcStr:AnsiString):string;var SrcLen,SecCount,ResLen:Integer; rHeadLen:Integer; i,j:Integer; i40:int40; tStr:AnsiString;begin SrcLen:=Length(SrcStr); SecCount:=SrcLen div 5; ResLen:=SrcLen mod 5; Result:=''; if ResLen>0 then begin tStr:=StringOfChar(#0,5-ResLen)+Copy(SrcStr,1,ResLen); for i:=1 to 5 do begin i40[i-1]:=tStr; end; Result:=Int40ToH32(i40); rHeadLen:=((ResLen*8) div 5)+1; Delete(Result,1,8-rHeadLen); end; for j:=0 to SecCount-1 do begin tStr:=Copy(SrcStr,ResLen+j*5+1,5); for i:=1 to 5 do begin i40[i-1]:=tStr; end; Result:=Result+Int40ToH32(i40); end;end;