This library provides rot13, rot47, caesar3, caesar N.
function layout for rot:
char rotNc(char c)
void rotNn(char * str, size_t len)
void rotN (char * str)
char * rotNndup(const char * str, size_t len)
char * rotNdup (const char * str)
N may either be 13 or 47.
function layout for caesar:
char caesar_encipher(char c, char n)
char caesar_decipher(char c, char n)
void caesar_nstr(char * str, size_t len, char n)
void caesar_str (char * str, char n)
char * caesar_ndup(char * str, size_t len, char n)
char * caesar_dup (char * str, char n)
char caesar3encipher(char c)
char caesar3decipher(char c)
void caesar3nstr(char * str, size_t len)
void caesar3str (char * str)
char * caesar3strndup(const char * str, size_t len)
char * caesar3strdup (const char * str)
single header library:
#define ROT13_EXPOSE static /* OPTIONAL */
Terribly poor implementation details (switch map for rot), and
some weird library side details (long names, dup/ndup and str/nstr
functions). Public domain, I don't see a reason to not implement these
algos yourself, though.
I imagine a real library would be much more flexible about sets, and
probably use regexps to some extent to probably handle sets. Which
would likely deduplicate the problem into only shift and rot files.
rotX was intentionally implemented stupidly, I promise.