Created
November 13, 2023 01:46
-
-
Save wirekang/f48a15e1b21be51f8d2741a904a38813 to your computer and use it in GitHub Desktop.
Postgres web-safe base64 encode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace function "base64_url"(bytea) returns text as | |
$$ | |
select replace(replace(replace(encode($1, 'base64'),'/','_'),'+','-'),'=',''); | |
$$ | |
language sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment