Caesar cypher function (https://en.wikipedia.org/wiki/Caesar_cipher)
Returns the encoding of aStr after a rotation of size offset. aStr is supposed to be a string composed uniquely from a-z characters.
aStr
offset
a-z
the string to cypher
the rotation to apply
the cyphered string
cypherCaesar(’abcde’, 1); // -> ’bcdef’cypherCaesar(’bcdef’, -1); // -> ’abcde’cypherCaesar(’abcde’, 13); // -> ’nopqr’cypherCaesar(’nopqr’, 13); // -> ’abcde’ Copy
cypherCaesar(’abcde’, 1); // -> ’bcdef’cypherCaesar(’bcdef’, -1); // -> ’abcde’cypherCaesar(’abcde’, 13); // -> ’nopqr’cypherCaesar(’nopqr’, 13); // -> ’abcde’
Caesar cypher function (https://en.wikipedia.org/wiki/Caesar_cipher)
Returns the encoding of
aStrafter a rotation of sizeoffset.aStris supposed to be a string composed uniquely froma-zcharacters.