3 ms·
We need to separate the storage format (Postgres and MySQL both have a bigint serial for primary key and it should stay that way) for display, you have various
by tttp 2y ago
We need to separate the storage format (Postgres and MySQL both have a bigint serial for primary key and it should stay that way)
for display, you have various ways to encode that number into something easier for humans, what I prefer:
- short word
- no offensive words
- with a checksum (so we easily spot any copy paste mistake)
- not sequential
- can be put in a url without extra encoding
this is our implementation of that (base32 and luhn code)
https://github.com/tttp/dxid https://github.com/tttp/dxid