bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] base64: Allow URL-safe base64 strings to be decoded


From: Bruno Haible
Subject: Re: [PATCH] base64: Allow URL-safe base64 strings to be decoded
Date: Thu, 05 Jul 2012 10:47:46 +0200
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

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.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]