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
cypher(’abcde’, 1); // -> ’bcdef’cypher(’bcdef’, -1); // -> ’abcde’cypher(’abcde’, 13); // -> ’nopqr’cypher(’nopqr’, 13); // -> ’abcde’ Copy
cypher(’abcde’, 1); // -> ’bcdef’cypher(’bcdef’, -1); // -> ’abcde’cypher(’abcde’, 13); // -> ’nopqr’cypher(’nopqr’, 13); // -> ’abcde’
Caesar cypher function (https://en.wikipedia.org/wiki/Caesar_cipher) Returns the encoding of
aStr
after a rotation of sizeoffset
.aStr
is supposed to be a string composed uniquely froma-z
characters.