Le 13/03/2024 à 17:06, Remi Collet a écrit :
PHPAPI extern zend_string *php_base64_encode_ex
(const unsigned char *, size_t, zend_long flags);
This is done in master
No change in user-land
and no plan from me.
Remi
On Fri, Mar 15, 2024 at 9:34 AM Remi Collet
wrote:
> Le 14/03/2024 à 21:31, Yasuo Ohgaki a écrit :
>
> > Please add PHP_BASE64_URL flag also.
>
> This is another feature, out of the scope of this PR
>
>
> Remi
>
Perhaps you should consider it? Base64 "just without" padding isn't really
a
Le 14/03/2024 à 21:31, Yasuo Ohgaki a écrit :
Please add PHP_BASE64_URL flag also.
This is another feature, out of the scope of this PR
Remi
>
> I think padding should be optional (on by default to keep BC)
>
> Of course in user land, simple to write
>
>$enc = trim(base64_encode('foo'), '=');
>
> This proposal allow to simply use
>
>$enc = base64_encode('foo', PHP_BASE64_NO_PADDING);
>
>
Please add PHP_BASE64_URL flag also.
Le 14/03/2024 à 12:46, Dik Takken a écrit :
Only I would strongly prefer a boolean argument over a flag.
Make sense.
PR updated
On 13-03-2024 17:06, Remi Collet wrote:
I think padding should be optional (on by default to keep BC)
Of course in user land, simple to write
$enc = trim(base64_encode('foo'), '=');
This proposal allow to simply use
$enc = base64_encode('foo', PHP_BASE64_NO_PADDING);
And also expose
Hi
On 3/13/24 17:06, Remi Collet wrote:
Use case: for ARGON2 password hashing
see https://github.com/php/php-src/pull/13635
It may seems ugly to add and remove th padding char
Is a RFC needed for such a minor feature ?
Previous related discussion:
Link to the PR https://github.com/php/php-src/pull/13698
I think padding should be optional (on by default to keep BC)
Of course in user land, simple to write
$enc = trim(base64_encode('foo'), '=');
This proposal allow to simply use
$enc = base64_encode('foo', PHP_BASE64_NO_PADDING);
And also expose it for extension as
PHPAPI extern