我复制了一些Java代码并将其粘贴到执行XOR操作的Groovy脚本中...
def XOR(String inn, String KEY) {
String key = KEY;
StringBuffer result = new StringBuffer();
for (int j = 0; j < inn.length(); j++) {
if (j > key.length() - 1) {
key += KEY;
}
result.append((char) (inn.charAt(j) ^ key.charAt(j)));
}
return result.toString();
}
执行“ result.append”时会出现以下错误。...
Caught: groovy.lang.MissingMethodException:
No signature of method: java.lang.Character.xor() is
applicable for argument types: (java.lang.Character) values: [z]
能否请您告诉我如何解决?