Live data from Hacker News

Sqids – Generate short unique IDs from numbers

sqids.org

21–30 of 249 posts

Re: Sqids – Generate short unique IDs from numbers

#22
post #12

I like the idea, though I use nanoid with the safe letter dictionary (it excludes letters used for profanity[0]) They should use a similar dictionary approach IMO because I looked at the implementation and it’s hardcoded to look for “bad” words Otherwise looks real straightforward! I’d love to see some performance test suites for it [0]: https://github.com/sqids/sqids-javascript/blob/ebca95e114932... [1]: though with…

> 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…

[deleted]

Re: Sqids – Generate short unique IDs from numbers

#24
post #15
post #3

It's weird under "Get Started" they have links to 40 different languages. You can only get started with 15 of the 40 languages listed, the other 25 are skeleton repos asking for people to start the repo to indicate interest.

It’s kinda clever. The people most likely to look at this project are also likely ideal candidates for implementing the library in a new language (Developer, FOSS enthusiast, interested in the project, need the library in a language they’re familiar with that isn’t implemented yet). Also, the language pills differentiate between those that have been implemented (color logo, dark text, bold) and those that aren’t (gra…

Good points. Those pages also contain links to old implementations (Hashids), because a lot of projects still use those and want to be able to find them.

Re: Sqids – Generate short unique IDs from numbers

#25
post #15
post #3

It's weird under "Get Started" they have links to 40 different languages. You can only get started with 15 of the 40 languages listed, the other 25 are skeleton repos asking for people to start the repo to indicate interest.

It’s kinda clever. The people most likely to look at this project are also likely ideal candidates for implementing the library in a new language (Developer, FOSS enthusiast, interested in the project, need the library in a language they’re familiar with that isn’t implemented yet). Also, the language pills differentiate between those that have been implemented (color logo, dark text, bold) and those that aren’t (gra…

Also can help track which languages people click on, probably a good proxy of where there would be the need to develop a lib

Re: Sqids – Generate short unique IDs from numbers

#26
post #21
post #14

What’s the use case for passing in an array of numbers? Typically when generating an ID my input is either a single random number, a string that’s being hashed, or nothing at all.

[shard_number, primary_id_number, timestamp]

But then why not just arbitrary text?

Re: Sqids – Generate short unique IDs from numbers

#27
post #12

I like the idea, though I use nanoid with the safe letter dictionary (it excludes letters used for profanity[0]) They should use a similar dictionary approach IMO because I looked at the implementation and it’s hardcoded to look for “bad” words Otherwise looks real straightforward! I’d love to see some performance test suites for it [0]: https://github.com/sqids/sqids-javascript/blob/ebca95e114932... [1]: though with…

> 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…

Omit vowels and you're 90% of the way there; omit the vowel-looking digits 0,1,3,4 and you're probably >99% of the way there.
Post reply on HN