摘要:
functionHexStrToStream(AHexStr:String;AStream:TStream):Boolean;variLen:Integer;Buff:String;P1,P2:PChar;B:Byte;beginResult:=False;ifNotAssigned(AStream)thenExit;iLen:=Length(AHexStr);ifiLen=0thenExit;if(iLenmod2)<>0thenExit;SetString(Buff,Nil,iLendiv2);P1:=PChar(AHexStr);P2:=PChar(Buff);whileiL 阅读全文
摘要:
functionStreamToHexStr(AStream:TStream):String;constHexChars:array[0..15]ofChar='0123456789ABCDEF';vari,len:Integer;beginlen:=AStream.Size-AStream.Position;SetLength(Result,len*2);AStream.Read(Pointer(Result)^,len);fori:=lendownto1dobeginResult[i*2]:=HexChars[Byte(Result[i])and$0F];Result[i* 阅读全文