Add support for base64url encoding and decoding

This adds support for base64url encoding and decoding, a base64
variant which is safe to use in filenames and URLs.  base64url
replaces '+' in the base64 alphabet with '-' and '/' with '_',
thus making it safe for URL addresses and file systems.

Support for base64url was originally suggested by Przemysław Sztoch.

Author: Florents Tselai <[email protected]>
Reviewed-by: Aleksander Alekseev <[email protected]>
Reviewed-by: David E. Wheeler <[email protected]>
Reviewed-by: Masahiko Sawada <[email protected]>
Reviewed-by: Daniel Gustafsson <[email protected]>
Reviewed-by: Chao Li (Evan) <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e1d917182c1953b16b32a39ed2fe38e3d0823047

Modified Files
--------------
doc/src/sgml/func/func-binarystring.sgml |  19 ++++
src/backend/utils/adt/encode.c           | 157 ++++++++++++++++++++++++++-----
src/test/regress/expected/strings.out    | 150 +++++++++++++++++++++++++++++
src/test/regress/sql/strings.sql         |  54 +++++++++++
4 files changed, 359 insertions(+), 21 deletions(-)

Reply via email to