import string


def caesar(txt, rot=7):
    """Caesar Cipher through ASCII manipulation.

    Based on https://stackoverflow.com/questions/8886947/caesar-cipher-function-in-python/54590077#54590077
    """
    if rot % 26 == 0:
        # Do nothing for rot0
        return txt

    def rot_alphabet(alphabet):
        return alphabet[rot:] + alphabet[:rot]

    # create alphabet (upper and lower case ASCII) by roting independently
    alphabets = (string.ascii_lowercase, string.ascii_uppercase)
    shifted_alphabets = tuple(map(rot_alphabet, alphabets))

    # combine alphabets
    joined_alphabets = ''.join(alphabets)
    joined_shifted_alphabets = ''.join(shifted_alphabets)

    # map the translate and apply
    table = str.maketrans(joined_alphabets, joined_shifted_alphabets)
    return txt.translate(table)