Bruno Haible <br...@clisp.org> writes:

> Hi,
>
> Wido den Hollander wrote:
>> With URL-safe base64 the + and / are replaced by - and _
>> 
>> This way we can accept base64 strings which are URL-safe.
>
> There are many more variants of base64, see
>   http://en.wikipedia.org/wiki/Base64
>
> The current code is meant to implement RFC 4648. Since for RFC 4648 characters
> outside the alphabet are forbidden, your patch would break this use-case.
>
> I think if the module should be usable for other variants than RFC 4648,
> the proper implementation is to have an 'enum' that identifies the variant
> and to pass this enum as parameter to the functions isbase64, base64_encode,
> base64_decode_ctx, etc.

I agree.  Note that RFC 4648 covers the URL-safe alphabet too, so the
code actually just implement a subset of RFC 4648 today.

/Simon

Reply via email to