Live data from Hacker News

Sqids – Generate short unique IDs from numbers

sqids.org

161–170 of 249 posts

Re: Sqids – Generate short unique IDs from numbers

#161
post #42

Earlier 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.

No, squids are predictable, you can't use them to hide information. They call it out on their front page.

I haven't looked at the implementation yet but HashIds (the former project name) required a salt. It would be weird if they changed that.

Re: Sqids – Generate short unique IDs from numbers

#162
post #70

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…

I always take note of invoice numbers for this exact reason, they give you a feel for how busy they are.

Re: Sqids – Generate short unique IDs from numbers

#163

Earlier quoted context omitted.

The stupid simple way I did this ages ago was: 1. Start with a-z. 2. Drop all vowels, numbers, most homoglyphs, and the letter 'x'. 3. Map digits 0-9 to one of the remaining letters. 4. Stringify the integer and replace the digit in each decimal place with its corresponding character. For my use-case, all the numbers were >7 digits long, so the odds of you getting an offensive acronym were reasonably low unless you s…

Most numbers can be used as letters or phonemes. I could give a fuck about avoiding swear words, but if you want to avoid slurs and eyebleach-inducing ideas and still have any sort of compact representation, I suspect we have to look not at problematic letters but problematic groups of letters. There's nothing intrinsically wrong with the letter E. Not with G, I, N, or R, but you can sure get a lot of attention you d…

[deleted]

Re: Sqids – Generate short unique IDs from numbers

#164

Earlier quoted context omitted.

Could you just remove vowels and hit 99.9% of profanity in all languages? Ditto for removing their 0-9 equivalents, if you're really worried about it. Quick out of the box support for that via being able to define a custom alphabet.

You might still have issues with generating sequences like "XtrmlyBdWrd" that are still recognizable.

Well until we figure out a way to remove pattern matching from humans... use GUIDs if that's an issue. Removing vowels fixes "spelling almost all bad words explicitly", though I'm open to being proven wrong with fun new swears in exotic (to me) languages :)

The problem of "pick any N symbols that don't make any profanity in any language across all time" isn't what this is solving, nor should it have to. Take the same concept but use whitelisted words to build the token if you're that adverse to computer generated, fill in the blank naughty words. Keep "pen" and "island", among other things, off that list ;)

Re: Sqids – Generate short unique IDs from numbers

#167
post #70

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…

Can confirm, when I worked in VC we used this to verify order volume for a number of startups we were evaluating. For one startup, I wrote a bot to place a small order a few times a day, and log the order number.

Did you use this for due diligence to verify that the data reported by the entrepreneur in the pitch was good or you were looking at some companies in a specific space and checking the company that has more orders?

Re: Sqids – Generate short unique IDs from numbers

#168

Earlier quoted context omitted.

ehm, yeah, n=2 will not get you anything useful... that'll be like trying to determine the average salary in a company with only two known ones, which could be the janitor's and the CEO's

> that'll be like trying to determine the average salary in a company with only two known ones, which could be the janitor's and the CEO's Ironically that would be somewhat close to the actual average.

It would be significantly above the average unless the company is ridiculously top-heavy or has shockingly little variation in salary. Or if the "salary" for the CEO ignores certain compensation (eg: paid a salary of $1 + stock options).

Re: Sqids – Generate short unique IDs from numbers

#169

I think the "unique IDs" part of the title throws people off and brings security to mind. "The main use of Sqids is purely visual" is what you need to know. It's not necessarily for IDs, it's just a user-friendly way to encode/decode numbers.

Also, why is it non-sequential? That suggests it's unpredictable, but it's not. Just realized that was the thing bothering me about this.

Re: Sqids – Generate short unique IDs from numbers

#170
post #129

Earlier quoted context omitted.

Did they never make an IKEA purchase after that or did they get over it like a normal adult? I don't work retail, but something tells me people will make a stink out of just about anything if it meant potentially free products or other compensation. Plus, are you filtering just English curse words or all curse words for countries that use Latin characters?

The risk is not in offending someone, but in that someone posting the rude string on social media in real or mock indignation, causing the outrage machine to turn on your brand. There’s a steady supply of bottom-feeding journalists waiting to write the article “IKEA’s new system is sending hate messages to customers”.

Can you cite an example of a journalist writing an article that makes such an accusation?
Post reply on HN