function Encrypt(const InString:string; StartKey,MultKey,AddKey:Integer): string;
var
I : Byte;
begin
Result := '';
for I := 1 to Length(InString) do
begin
Result := Result + CHAR(Byte(InString[I]) xor (StartKey shr 8));
StartKey := (Byte(Result[I]) + StartKey) * MultKey + AddKey;
end;
end;
中的 CHAR(Byte(InString[I]) 如何打这句话转成 java语法吗?两句话是等价的在线等
var
I : Byte;
begin
Result := '';
for I := 1 to Length(InString) do
begin
Result := Result + CHAR(Byte(InString[I]) xor (StartKey shr 8));
StartKey := (Byte(Result[I]) + StartKey) * MultKey + AddKey;
end;
end;
中的 CHAR(Byte(InString[I]) 如何打这句话转成 java语法吗?两句话是等价的在线等
你试试
循环InString.substring(I-1,I);来取出每个字符