pg_hashids
Short unique id generator for PostgreSQL, using hashids
Repository
iCyberon/pg_hashids
https://github.com/iCyberon/pg_hashids
Source
pg_hashids-1.3.tar.gz
pg_hashids-1.3.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_hashids | 1.3 | FUNC | MIT | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4550 | pg_hashids | No | Yes | No | Yes | No | Yes | - |
| Related | base36 base62 pg_base58 url_encode pg_slug_gen typeid pgqr |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.3 | 1817161514 | pg_hashids | - |
| RPM | PIGSTY | 1.3 | 1817161514 | pg_hashids_$v | - |
| DEB | PIGSTY | 1.3 | 1817161514 | postgresql-$v-pg-hashids | - |
Build
You can build the RPM / DEB packages for pg_hashids using pig build:
Install
You can install pg_hashids directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
Converts numbers like 347 into strings like “yr8”. Useful for obfuscating database primary keys.
Functions
| Function | Description |
|---|---|
id_encode(number [, salt [, min_length [, alphabet]]]) | Encode an integer to a hashid string |
id_decode(hash, salt, min_length [, alphabet]) | Decode a hashid string back to integer array |
id_decode_once(hash [, salt [, min_length [, alphabet]]]) | Decode a hashid string back to a single integer |
Examples
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)