News for hackers. Stuff that matters.
Re:Sqids – Generate Short Unique IDs from Numbers by hot_gril on Monday November 27, 2023 @10:12PM (#38441840)
> Where do you have unique ids that aren’t the primary key?

For things that need public IDs, I always generate and store uuid4s* to avoid leaking database state or anything like that. Even uuid7 leaks creation timestamps. It's cheap and easy to map public IDs to/from PKs at the API boundaries.

* possibly encoded as something nicer like base64 for APIs or URLs

There are no comments on this comment yet.