diff options
author | Daniel Gustafsson <dgustafsson@postgresql.org> | 2025-09-20 23:19:32 +0200 |
---|---|---|
committer | Daniel Gustafsson <dgustafsson@postgresql.org> | 2025-09-20 23:19:32 +0200 |
commit | e1d917182c1953b16b32a39ed2fe38e3d0823047 (patch) | |
tree | a107b80202efa1d95f6d994dec3665bd7652e679 /doc/src | |
parent | 261f89a976bf3dbf25e43bab9983fdd28f20b49b (diff) |
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 <florents.tselai@gmail.com>
Reviewed-by: Aleksander Alekseev <aleksander@timescale.com>
Reviewed-by: David E. Wheeler <david@justatheory.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Chao Li (Evan) <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/70f2b6a8-486a-4fdb-a951-84cef35e22ab@sztoch.pl
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func/func-binarystring.sgml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/src/sgml/func/func-binarystring.sgml b/doc/src/sgml/func/func-binarystring.sgml index 78814ee0685..9bab965f288 100644 --- a/doc/src/sgml/func/func-binarystring.sgml +++ b/doc/src/sgml/func/func-binarystring.sgml @@ -728,6 +728,7 @@ Encodes binary data into a textual representation; supported <parameter>format</parameter> values are: <link linkend="encode-format-base64"><literal>base64</literal></link>, + <link linkend="encode-format-base64url"><literal>base64url</literal></link>, <link linkend="encode-format-escape"><literal>escape</literal></link>, <link linkend="encode-format-hex"><literal>hex</literal></link>. </para> @@ -785,6 +786,24 @@ </listitem> </varlistentry> + <varlistentry id="encode-format-base64url"> + <term>base64url + <indexterm> + <primary>base64url format</primary> + </indexterm></term> + <listitem> + <para> + The <literal>base64url</literal> format is that of + <ulink url="https://datatracker.ietf.org/doc/html/rfc4648#section-5"> + RFC 4648 Section 5</ulink>, a <literal>base64</literal> variant safe to + use in filenames and URLs. The <literal>base64url</literal> alphabet + use <literal>'-'</literal> instead of <literal>'+'</literal> and + <literal>'_'</literal> instead of <literal>'/'</literal> and also omits + the <literal>'='</literal> padding character. + </para> + </listitem> + </varlistentry> + <varlistentry id="encode-format-escape"> <term>escape <indexterm> |