function Tdm.addmm(s:string):string;
var
i,j:Integer;
Asc:Byte;
begin
Result:='';
for i:=1 to Length(S) do
begin
if (i mod Length(SdString)) = 0 then
j:=Length(SdString)
else
j:=(i mod Length(SdString));
Asc:=Byte(S[i]) xor Byte(SdString[j]);
Result:=Result+IntToHex(Asc,3);
end;
end;
var
i,j:Integer;
Asc:Byte;
begin
Result:='';
for i:=1 to Length(S) do
begin
if (i mod Length(SdString)) = 0 then
j:=Length(SdString)
else
j:=(i mod Length(SdString));
Asc:=Byte(S[i]) xor Byte(SdString[j]);
Result:=Result+IntToHex(Asc,3);
end;
end;
public static String addmm(String s) {
String ret = "";
int j;
byte asc;
for(int i=0; i<s.length(); i++) {
if ((i+1) % s.length()==0) j = s.length()-1;
else j = i % s.length();
asc = (byte) ((byte) s.charAt(i) ^ (byte) s.charAt(j));
String tmp = Integer.toHexString(asc);
tmp = String.format("%3s", tmp);
ret = ret.concat(tmp.replace(" ", "0"));
}
return ret;
}