can someone translate this for me


Looking through some cipher code and I was hoping i can get a better understanding of this equation;
1
2
3
4
5
6
7
8
if (ch >= 'A' && ch <= 'Z') //If the character is in the alphabet...
            {
                ch = 'A' + (((ch - 'A') + shift + 26) % 26);
            }
            if (ch >= 'a' && ch <= 'z') //If the character is in the alphabet...
            {
                ch = 'a' + (((ch - 'a') + shift + 26) % 26);
            }


mainly the whole ch = a + ch - a
if ch is f then would f + a = g?
Last edited on
closed account (48T7M4Gy)
This is the Caesar encoding of uppercase and then lowercase characters of the alphabet with a shift value of 'shift'.
Last edited on
Topic archived. No new replies allowed.