Skip to content

Instantly share code, notes, and snippets.

View beoliver's full-sized avatar

Benjamin Oliver beoliver

View GitHub Profile
@beoliver
beoliver / vigenere.py
Last active December 10, 2015 23:48
a (functional) python 3.x vigenere encoder / decoder.
# ben oliver 11.01.2013
# a (functional) python 3.x vigenere encoder / decoder.
# encode and decode functions are mathematical, no dictionary lookups.
from itertools import cycle
from functools import partial
from string import ascii_uppercase
def transform(crypt_function,k,s):
""" (Int -> Int -> Int) -> Char -> Char -> Char """