14
I have a function in C#, where I decrypt a string and need to convert into a function in SQL Server for technicians to be able to work with the decrypted value.
There is a foreach, I don’t understand how it works:
var calculoChave = 0;
foreach (var c in chave)
{
calculoChave ^= c;
}
What does this " =", and what it does?
Debugging the code, I realized that when the key has a number, it adds up to 48. Equal, if the key is equal to 3, the value of the key calculation will be 51. If the key has more than 2 numbers, change the calculation, and I did not find a logical sequence for this.
what type of variable
chave
? AString
?– mateusalxd
Do you want to know if there is a XOR operator in SQL? Or what it is
^=
?– Maniero
@Matthew The key is string yes.
– Randrade
@bigown would like to know what it is, to better understand the code. But since commented, I was doubtful if it exists in sql as well.
– Randrade