Open mightybyte opened 4 years ago
That sounds good to me, @mightybyte, provided the changes are backwards-compatible.
Do you have a suggestion as to how the package should expose the new functionality? The current API is as follows:
{ btoa :: String -> String, atob :: String -> String }
I don't have anything in mind. I figured you would have more opinions about it than me. Since we don't have to match the existing atob
and btoa
API it seems like there's a good bit more flexibility. Maybe call them encodeBase64Url
and decodeBase64Url
or something?
If someone is interested in making this change, I will gladly review a pull request. :)
What do you think about adding support for the base64url encoding to this package? The only difference between base64url and base64 is the encoding of the 62nd and 63rd alphabet characters (https://tools.ietf.org/html/rfc4648#page-7). It seems a shame to do a whole separate pass over the string just to make this small change (as is done here https://github.com/joaquimserafim/base64-url/blob/master/index.js#L10).