• 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.

    Parameters

    • aStr: string

      the string to cypher

    • offset: number

      the rotation to apply

    Returns string

    the cyphered string

    cypher(’abcde’, 1);  // -> ’bcdef’
    cypher(’bcdef’, -1); // -> ’abcde’
    cypher(’abcde’, 13); // -> ’nopqr’
    cypher(’nopqr’, 13); // -> ’abcde’