Re: encode/decode support for base64url

2025-05-06 Thread Pavel Seleznev
Hi, In the strings.sql file there is such code SELECT encode('\x69b73eff', 'base64'); -- Expected: abc+/w== In the strings.out file +SELECT encode('\x69b73eff', 'base64'); -- Expected: abc+/w== + encode +-- + abc+/w== +(1 row) + maybe you should remove the additional description of the e

Re: encode/decode support for base64url

2025-03-31 Thread Aleksander Alekseev
Hi Florents, > Here's a v3 with some (hopefully) better test cases. Thanks for the new version of the patch. ``` +encoded_len = pg_base64_encode(src, len, dst); + +/* Convert Base64 to Base64URL */ +for (uint64 i = 0; i < encoded_len; i++) { +if (dst[i] == '+') +d

Re: encode/decode support for base64url

2025-03-14 Thread Florents Tselai
On Tue, Mar 11, 2025 at 10:08 AM Florents Tselai wrote: > > > On Tue, Mar 11, 2025 at 12:51 AM Cary Huang wrote: > >> > Oh well - you're probably right. >> > I guess I was blinded by my convenience. >> > Adding a 'base64url' option there is more appropriate. >> >> I agree with it too. It is neat

Re: encode/decode support for base64url

2025-03-11 Thread Cary Huang
> Oh well - you're probably right. > I guess I was blinded by my convenience. > Adding a 'base64url' option there is more appropriate. I agree with it too. It is neater to add "base64url" as a new option for encode() and decode() SQL functions in encode.c. In addition, you may also want to add th

Re: encode/decode support for base64url

2025-03-11 Thread Florents Tselai
On Tue, Mar 11, 2025 at 12:51 AM Cary Huang wrote: > > Oh well - you're probably right. > > I guess I was blinded by my convenience. > > Adding a 'base64url' option there is more appropriate. > > I agree with it too. It is neater to add "base64url" as a new option for > encode() and decode() SQL

Re: encode/decode support for base64url

2025-03-10 Thread Przemysław Sztoch
On 07.03.2025 15:40, Aleksander Alekseev wrote: Hi, Sometimes support for base64url from RFC 4648 would be useful. Does anyone else need a patch like this? While not a frequent ask, it has been mentioned in the past. I think it would make sense to add so please do submit a patch for it for co

Re: encode/decode support for base64url

2025-03-10 Thread Florents Tselai
On Mon, Mar 10, 2025, 14:32 Daniel Gustafsson wrote: > > On 10 Mar 2025, at 12:28, Florents Tselai > wrote: > > > Here's a C implementation for this, along with some tests and > documentation. > > Tests are copied from cpython's implementation of urlsafe_b64encode and > urlsafe_b64decode. > > +

Re: encode/decode support for base64url

2025-03-10 Thread Daniel Gustafsson
> On 10 Mar 2025, at 12:28, Florents Tselai wrote: > Here's a C implementation for this, along with some tests and documentation. > Tests are copied from cpython's implementation of urlsafe_b64encode and > urlsafe_b64decode. + base64url_encode ( input bytea ) Shouldn't this be modelle

Re: encode/decode support for base64url

2025-03-10 Thread Florents Tselai
On Sun, Mar 9, 2025 at 12:28 AM Florents Tselai wrote: > > > On 7 Mar 2025, at 4:40 PM, Aleksander Alekseev > wrote: > > Hi, > > Sometimes support for base64url from RFC 4648 would be useful. > Does anyone else need a patch like this? > > > While not a frequent ask, it has been mentioned in the

Re: encode/decode support for base64url

2025-03-08 Thread Florents Tselai
> On 7 Mar 2025, at 4:40 PM, Aleksander Alekseev > wrote: > > Hi, > >>> Sometimes support for base64url from RFC 4648 would be useful. >>> Does anyone else need a patch like this? >> >> While not a frequent ask, it has been mentioned in the past. I think it >> would >> make sense to add so

Re: encode/decode support for base64url

2025-03-07 Thread Aleksander Alekseev
Hi, > > Sometimes support for base64url from RFC 4648 would be useful. > > Does anyone else need a patch like this? > > While not a frequent ask, it has been mentioned in the past. I think it would > make sense to add so please do submit a patch for it for consideration. IMO it would be nice to

Re: encode/decode support for base64url

2025-03-04 Thread Daniel Gustafsson
> On 4 Mar 2025, at 09:54, Przemysław Sztoch wrote: > Sometimes support for base64url from RFC 4648 would be useful. > Does anyone else need a patch like this? While not a frequent ask, it has been mentioned in the past. I think it would make sense to add so please do submit a patch for it for

encode/decode support for base64url

2025-03-04 Thread Przemysław Sztoch
Hello, Sometimes support for base64url from RFC 4648 would be useful. Does anyone else need a patch like this? -- Przemysław Sztoch | Mobile +48 509 99 00 66