Side note: there are some business insights you can get from a company using serial ids. i.e if you sign up and get user id 32588 and make another account a few days later, you can tell the growth rate of the company. And this is possible with every resource type in the application. I do wonder how much the url bar junk thing matters these days. I tend to use uulids (waiting on uuid v7 wide adoption), and they're a b…
Sqids – Generate short unique IDs from numbers
171–180 of 249 posts
Re: Sqids – Generate short unique IDs from numbers
#172Side note: there are some business insights you can get from a company using serial ids. i.e if you sign up and get user id 32588 and make another account a few days later, you can tell the growth rate of the company. And this is possible with every resource type in the application. I do wonder how much the url bar junk thing matters these days. I tend to use uulids (waiting on uuid v7 wide adoption), and they're a b…
What's the advantage of uuid7 (sequential + random) vs uuid4 (full random) for this?
Re: Sqids – Generate short unique IDs from numbers
#173For example, the number 5,702,400 becomes ~sorreg-namtyv. And 1,742,733,824 becomes ~master-morzod.
I enjoy the quirkiness of the names.
Re: Sqids – Generate short unique IDs from numbers
#174Earlier quoted context omitted.
I believe a big part of the idea is for the hash to be unpredictable as well. If I figure out you're using (36) then I know the next number 1234567891 is "kf12oj". Not the case with Sqids.
I'd prefer to use crockford-encoded entropy with Stripe-style token prefixes to create unique ID namespaces. Run in through a bad words filter, and it's perfect. user_1hrpt0xpax7ps file_xpax7psaz0tv6az0tv6 Etc. In distributed systems you can use the trailing bytes to encode things like author cluster, in case you're active-active and need to route subsequent writes before create event replication. Easy to copy, debug…
Re: Sqids – Generate short unique IDs from numbers
#175If the original numeric ID can be figured out from the sqid string, then what’s the point of the conversion?
Re: Sqids – Generate short unique IDs from numbers
#176Earlier quoted context omitted.
> it excludes letters used for profanity That doesn't seem possible. How would that work? > I looked at the implementation and it’s hardcoded to look for “bad” words. If you mean https://github.com/y-gagar1n/nanoid-good , that seems to be doing the same thing. In general, I'm a bit weary of solutions that "guarantee no bad words" – this is usually highly language-specific: One language's perfectly acceptable name is…
It's particularly funny because their example docs for .NET outputs "B4aajs", which to any Swedish l33t speaking individual, would read "Bajs", which means "shit"
Re: Sqids – Generate short unique IDs from numbers
#177Side note: there are some business insights you can get from a company using serial ids. i.e if you sign up and get user id 32588 and make another account a few days later, you can tell the growth rate of the company. And this is possible with every resource type in the application. I do wonder how much the url bar junk thing matters these days. I tend to use uulids (waiting on uuid v7 wide adoption), and they're a b…
I see so many organizations add weird slowdowns from debts associated with this. I reflect on some of the most successful tech businesses of the last decade and remember that all their APIs exposed this kind of data early on and many still do. Does anyone have an example they can reference of a business being harmed by this information being out there?
So I guess that kinda harmed that fraudulent business strategy…
Re: Sqids – Generate short unique IDs from numbers
#178Side note: there are some business insights you can get from a company using serial ids. i.e if you sign up and get user id 32588 and make another account a few days later, you can tell the growth rate of the company. And this is possible with every resource type in the application. I do wonder how much the url bar junk thing matters these days. I tend to use uulids (waiting on uuid v7 wide adoption), and they're a b…
Re: Sqids – Generate short unique IDs from numbers
#179Earlier quoted context omitted.
> most browsers Not chrome... Also, links are a thing in chat, etc
Heres what a recent youtube (which squid documents as a sample use case) link I shared looked like: > https://www.youtube.com/watch?v=fFMzQ3tYTFU&pp=ygURY2hQImVzZ... Or Twitter: > https://x.com/elonmusk/status/172853302828286055507?s=20 Or TikTok: > /video/730292574259232054785?is_from_webapp=1&sender_device=pc" rel="nofollow noreferrer">https://www.tiktok.com/@ /video/730292574259232054785... While I tend to strip t…
Don’t know how common that is. Wouldn’t be surprised if no -techies don’t know how to copy from url-bar.
Re: Sqids – Generate short unique IDs from numbers
#180In a Ruby app we just convert to a high base, like > 1234567890.to_s(36) => "kf12oi" That gets us most of the way there, but Sqid has a Ruby library and lets you set a much higher base, including upper case characters, and I suppose, emoji. We're going to need much bigger numbers before that space savings makes much difference. I like it, but it's hard to know when something like that is worth adding a dependency.
BaseEmoji is a thing: https://github.com/amoallim15/base-emoji
Which I guess is the part where senior (citizen) programmers like me get triggered as promised in the README.