the Base64 module seems to be hardcoded to use the standard alphabet - I need to consume data encoded with the urlsafe alphabet (-
,_
instead of +
,/
). As a workaround I’m translating the source string into the urlsafe equivalent before decoding, like
base64decode(replace(replace(str, "-", "+"), "_", "/"))
but this feels pretty dirty, and obviously impractical for arbitrary alphabets. I think there’s value in separating the base64 encoding/decoding routines from the alphabet they use, allowing convenience functions
urlsafebase64decode(str)
or the generic case
base64decode(str, alphabet=myAlphabet)