A base32 postgres extension. Supports RFC4648 and Crockford.
First, install pgx.
cargo pgx install pg14 --release
Add the extension to your database.
CREATE EXTENSION pg_base32;
Schema name: base32
$ SELECT base32.encode('hello');
encode
----------
NBSWY3DP
(1 row)
$ SELECT base32.decode('NBSWY3DP');
decode
--------------
\x68656c6c6f
(1 row)
$ SELECT convert_from(base32.decode('NBSWY3DP'), 'UTF8');
convert_from
--------------
hello
(1 row)
encode(data: text, variant: 'rfc4648' | 'crockford' = 'rfc4648', padding: bool = false) -> text
data: text
: Input datavariant: 'rfc4648' | 'crockford'
: The variant to usepadding: bool
: If padding should be used (only forrfc4648
)
decode(data: text, variant: 'rfc4648' | 'crockford' = 'rfc4648', padding: bool = false) -> bytea
data: text
: Encoded datavariant: 'rfc4648' | 'crockford'
: The variant to usepadding: bool
: If padding should be used (only forrfc4648
)
👤 vabatta
- Github: @vabatta
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator