Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions
Date
Msg-id CAJ7c6TM=xPAwj4AvN6O4qXa7vc5cLGdDZb21ohqKp-cy2TJyWA@mail.gmail.com
Whole thread
In response to Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions  (Chengxi Sun <chengxisun92@gmail.com>)
Responses Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions
Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions
List pgsql-hackers
Hi,

> I might be missing some context here, so I wanted to ask: is this behavior intentional,
> or would it make sense to enforce stricter validation for Base32hex input?

That's intentional - see the discussion above:

"""
[...]
This code checks if the remaining bits of the input data are all zero.
IIUC we don't have a similar check for base64 and base64url. For
instance, the following input data is accepted:

=# select decode('AB', 'base64');
 decode
--------
 \x00
(1 row)
"""

Also see the documentation in respect of padding.

-- 
Best regards,
Aleksander Alekseev



pgsql-hackers by date:

Previous
From: Chengxi Sun
Date:
Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions
Next
From: Bertrand Drouvot
Date:
Subject: Re: Adding locks statistics