Re: [PHP-DEV] base64_encode without padding

2024-03-27 Thread Remi Collet
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

Re: [PHP-DEV] base64_encode without padding

2024-03-15 Thread Robert Landers
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

Re: [PHP-DEV] base64_encode without padding

2024-03-15 Thread Remi Collet
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

Re: [PHP-DEV] base64_encode without padding

2024-03-14 Thread Yasuo Ohgaki
> > 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.

Re: [PHP-DEV] base64_encode without padding

2024-03-14 Thread Remi Collet
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

Re: [PHP-DEV] base64_encode without padding

2024-03-14 Thread Dik Takken
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

Re: [PHP-DEV] base64_encode without padding

2024-03-13 Thread Tim Düsterhus
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:

Re: [PHP-DEV] base64_encode without padding

2024-03-13 Thread Remi Collet
Link to the PR https://github.com/php/php-src/pull/13698

[PHP-DEV] base64_encode without padding

2024-03-13 Thread Remi Collet
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