pgcrockford: Crockford Base 32 encoding for unsigned ints

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: pgsql-announce(at)lists(dot)postgresql(dot)org
Subject: pgcrockford: Crockford Base 32 encoding for unsigned ints
Date: 2019-09-08 20:55:21
Message-ID: 0CDD260B-17EF-4907-8D17-59171F082144@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-announce

The pgcrockford extension provides Base 32 encoded integers as a
PostgreSQL base type. From [Douglas Crockford's
requirements][crockford] for the specification, the encoding should

> - Be human readable and machine readable.
> - Be compact. Humans have difficulty in manipulating long strings of arbitrary symbols.
> - Be error resistant. Entering the symbols must not require keyboarding gymnastics.
> - Be pronounceable. Humans should be able to accurately transmit the symbols to other humans using a telephone.

[crockford]: https://www.crockford.com/base32.html

The motivation for pgcrockford is to provide a more humane display of
values used for surrogate keys while preserving space efficiency:
crockford values are represented as alpha-numeric strings while using
unsigned integers for their implementation.

A quick example:

select 'POSTGRESQL'::crockford8, 'POSTGRESQL'::crockford8::int8;
crockford8 | int8
------------+-----------------
P0STGRESQ1 | 774943659222753
(1 row)

https://github.com/grzm/pgcrockford

Cheers!

Michael Glaesemann
grzm seespotcode net

Browse pgsql-announce by date

  From Date Subject
Next Message Pavan Deolasee 2019-09-11 05:06:34 PGConf India 2020: Call for Papers
Previous Message David Fetter 2019-09-08 20:40:37 == PostgreSQL Weekly News - September 8, 2019 ==