fix error + format

This commit is contained in:
2025-04-29 00:29:00 +02:00
parent 3307f89d7d
commit 99f1890257
63 changed files with 9380 additions and 7015 deletions
+15 -10
View File
@@ -1,19 +1,24 @@
function XOR_hex(a, b) {
var res = "", i = a.length, j = b.length;
var res = '',
i = a.length,
j = b.length
while (i-- > 0 && j-- > 0)
res = (parseInt(a.charAt(i), 16) ^ parseInt(b.charAt(j), 16)).toString(16) + res;
return res;
res =
(parseInt(a.charAt(i), 16) ^ parseInt(b.charAt(j), 16)).toString(
16
) + res
return res
}
function hexEncode(a) {
let hex;
let result = "";
let hex
let result = ''
for (let i = 0; i < a.length; i++) {
hex = a.charCodeAt(i).toString(16);
result += ("000" + hex).slice(-4);
hex = a.charCodeAt(i).toString(16)
result += ('000' + hex).slice(-4)
}
return result;
return result
}
function xor(a, b) {
return XOR_hex(hexEncode(a), hexEncode(b)).toString("hex");
return XOR_hex(hexEncode(a), hexEncode(b)).toString('hex')
}
export default xor;
export default xor