News for hackers. Stuff that matters.
Re:Sqids – Generate Short Unique IDs from Numbers by Bytewave81 on Saturday November 25, 2023 @03:44PM (#38416524)
The idea is that you encode and decode database IDs with this. You wouldn't save them separately unless you were using it for a purpose other than shareable "identifiers" which don't leak significant amounts of database state. Imagine something like a link shortener where you want to provide a short link to users, but don't want it to just be a number.
Re:Sqids – Generate Short Unique IDs from Numbers by ComputerGuru on Monday November 27, 2023 @09:46AM (#38432790)
My point was that this only encodes numbers and you wouldn’t use numbers as primary keys for the reasons outlined.
Re:Sqids – Generate Short Unique IDs from Numbers by hot_gril on Monday November 27, 2023 @10:11PM (#38441829)
These leak the state just as much. They're reversible back to integers.