The alphabet (and its indices) can be found here:
http://www.garykessler.net/library/base64.html
Is there a shorter way than alphabet = ['A','B',...]
of representing this alphabet?
You can use the string
module
import string
alphabet = string.ascii_uppercase + string.ascii_lowercase + string.digits + '+/'