function algo() {
return {
keygen: {
userId: null,
gameId: null,
tableId: null,
temp: null,
resultNum1: new Array,
resultNum2: new Array,
resultNum3: new Array,
resultNum12: new Array,
resultNum23: new Array,
resultNum123: new Array,
resultChar1: new Array,
resultChar2: new Array,
resultChar3: new Array,
resultChar12: new Array,
resultChar23: new Array,
resultChar123: new Array,
setGameId: function (A) {
this.gameId = A
},
init: function (A, g, I) {
this.userId = A,
this.gameId = g || this.gameId,
this.tableId = I,
temp = "",
this.resultNum1 = this.numFunc(this.userId),
this.resultNum2 = this.numFunc(this.gameId),
this.resultNum3 = this.numFunc(this.tableId),
this.resultNum12 = this.ooxoroo(this.resultNum1, this.resultNum2),
this.resultNum123 = this.ooxoroo(this.resultNum12, this.resultNum3);
for (var B = new Array, t = 0; t < 4; t++) B[t] = String.fromCharCode(Number(this.resultNum123[t]) + 97);
this.resultChar1 = this.charFunc(this.userId),
this.resultChar2 = this.charFunc(this.gameId),
this.resultChar3 = this.charFunc(this.tableId);
for (var e = 0; e < 4; e++) this.resultChar3[e] = Number(this.resultChar3[e]) - 97;
this.resultChar12 = this.ooxoroo(this.resultChar1, this.resultChar2),
this.resultChar123 = this.ooxoroo(this.resultChar12, this.resultChar3);
for (var s = new Array, i = 0; i < 4; i++) Number(this.resultChar123[i]) > 9 ? (s[i] = Math.floor(Number(this.resultChar123[i]) / 10 + Number(this.resultChar123[i])), Number(s[i]) >= 10 && (s[i] = 9)) : s[i] = Math.floor(this.resultChar123[i]);
var a = new Array;
a = B.concat(s);
for (var r = 0; r < a.length; r++) temp = temp + "" + a[r];
return temp
},
numFunc: function (A) {
var g, I = 0,
B = new Array,
t = (new Array, new Array);
g = A.length;
for (var e = 0; e < g; e++) A.charCodeAt(e) >= 48 && A.charCodeAt(e) <= 57 && A.charAt(e) != A.charAt(e - 1) && (B[I] = A.charAt(e), I++);
for (e = 0; e < B.length; e++) for (var s = 0; s < B.length; s++) e != s && B[e] == B[s] && B.splice(s < e ? e: s, 1);
if ((t = B.splice(0, 4)).length < 4) {
for (var i = t.length; i < 4; i++) t.push("0");
return t
}
return t
},
ooxoroo: function (A, g) {
for (var I = new Array, B = 0; B < 4; B++) I[B] = A[B] ^ g[B];
return I
},
charFunc: function (A) {
for (var g = new Array, I = new Array, B = new Array, t = A, e = 0, s = 0; s < t.length; s++) 115 != t.charCodeAt(s) && 105 != t.charCodeAt(s) && 116 != t.charCodeAt(s) && 97 != t.charCodeAt(s) && 110 != t.charCodeAt(s) || t.charAt(s) != t.charAt(s - 1) && (g[e] = t.charAt(s), e++);
for (var i = 0; i < g.length; i++) for (var a = 0; a < g.length; a++) i != a && g[i] == g[a] && g.splice(a < i ? i: a, 1);
if ((I = g.splice(0, 4)).length < 4) for (var r = I.length; r < 4; r++) I.push("u");
for (var Q = 0; Q < 4; Q++) B[Q] = Number(I[Q].charCodeAt(0));
return B
}
}
}
}
What I have tried:
I want to change the above code to full C# code.
Sorry for not knowing Java
There are many things I don't understand.
Please