Created
October 23, 2015 09:11
-
-
Save thewisenerd/2a8738df894ddf744291 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// caesar cipher algorithm in C | |
#define C_CIPHER (-28) | |
#define pyMod(n, M) (((n % M) + M) % M) | |
if (data > 64) { // if >= A | |
if (data < 91) { // if <= Z | |
data = 'A' + pyMod(((data - 'A') + cipher), 26); | |
} // <= Z | |
if (data > 96) { // if >= a | |
if (data < 123) { // if <= z | |
data = 'a' + pyMod(((data - 'a') + cipher), 26); | |
} // // if <= z | |
} // >= a | |
} // if >= A |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment