apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <minf...@sharp.fm>
Subject Re: pool based base64 binary encode
Date Thu, 19 Jan 2017 14:10:05 GMT
On 19 Jan 2017, at 3:22 PM, Dirk-Willem van Gulik <dirkx@webweaving.org> wrote:

> Any reason we do not have such in APR-2 (as a compagnion to apr_pbase64_encode) ?
> 
> Dw.
> 
> 
> 
> APR_DECLARE(char *) apr_pbase64_encode_binary(apr_pool_t *p, const unsigned char *string,
int len)
> {
>    char *encoded;
> 
>    encoded = (char *) apr_palloc(p, 1 + apr_base64_encode_len(len));
>    len = apr_base64_encode_binary(encoded, string, len);
>    encoded[len] = '\0'; /* make binary sequence into string */
> 
>    return encoded;
> }

Ideally we should have a base64 variant here, and deprecate the existing functions:

http://apr.apache.org/docs/apr/1.5/group___a_p_r___util___escaping.html

Regards,
Graham
—


Mime
View raw message