I have the following VB code
Funtion Encripta(ByVal Pass As String) As String
Dim Clave As String, i As Integer, Pass2 As String
Dim Car As String, Codigo As String
Clave="%ü&/@#$A"
Pass2=""
For i=1 to Len(Pass)
CAR=Mid(Pass, i, 1)
Codigo=Mid(Clave, ((i-1) Mod Len(Clave)) +1,1)
Pass2= Pass2 & Right("0" & Hex(Asc(Codigo) Xor Asc(CAR)), 2)
Next i
Encripta = Pass2
I want to pass it to C #, which I take it to so far
public string Encripta(string Pass)
{
string Clave;
int i;
string Pass2;
string CAR;
string Codigo;
Clave = "%ü&/@#$A";
Pass2 = "";
for (i = 1; (i <= Pass.Length); i++)
{
CAR = Pass.Substring((i - 1), 1);
Codigo = Clave.Substring(((i - 1) % Clave.Length), 1);
}
return Pass2;
}
but so far I can not understand the last line, what would be the equivalence of this line in C #
Pass2= Pass2 & Right("0" & Hex(Asc(Codigo) Xor Asc(CAR)), 2)