Sqids – Generate Short Unique IDs from Numbers

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • sqids-ruby

    Official Ruby port of Sqids. Generate short unique IDs from numbers.

    I actually used sqids algo for something very different where I had to encode arbitrary sized byte arrays. And with Ruby it was very simple to remove limit - I think it was matter of monkey-patching https://github.com/sqids/sqids-ruby/blob/main/lib/sqids.rb#L... to return infinity.

    The reason for the limit is most likely to ensure interoperability with libraries in other languages where working with bignums is much more complicated.

  • CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  • proquint

    Proquints: Identifiers that are Readable, Spellable, and Pronounceable.

  • sqids-javascript

    Official JavaScript port of Sqids. Generate short unique IDs from numbers.

    Odd design decision in that if you provide your own blocklist, it overwrites their (extensive) default list instead of adding to it.

    And in general the algorithm is surprisingly complicated for something that could be replaced with simply base64 encoding, the given example (1,2,3) base64 encodes to a string with just one more letter than this algorithm.

    That said I do appreciate the semicolon-free-style. I don't typically see that in libs besides my own.

    https://github.com/sqids/sqids-javascript/blob/main/src/sqid...

  • nanoid-good

    Obscene words filter for nanoid

    > 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 another language's swear word.

  • nanoid-dictionary

    Predefined character sets to use with nanoid

    This is the implementation: https://github.com/CyberAP/nanoid-dictionary

    We use it in a highly internationalized product spanning multiple languages and haven’t yet ran into a complaint or value on audit that would constitute something offense in any language per our intl content teams anyway.

  • base-emoji

    BaseEmoji is a binary-to-emoji encoding scheme that represent binary data in a subset of the Unicode Emoji symbols, designed for triggering senior programmers effortlessly. BaseEmoji is heavily influenced by my furstration towards my tech lead that always shares data (base64 encoded) with me.

  • sqids-dotnet

    Official .NET port of Sqids. Generate short unique IDs from numbers.

    The approach definitely works. Some time ago I saw .NET listed but discovered it wasn't complete. I was eager to replace an existing Hashids implementation so I made some comments, shared a starter-snippet, and then someone was excited enough to complete in just a few days. It was great to see how quick the community stepped in. Maybe there was a bit of Cunningham's Law in effect with my contribution, ha.

    https://github.com/sqids/sqids-dotnet/issues/2#issuecomment-...

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • gfc64

    Obscures database sequential primary keys (or any 64-bit int) using a Feistel cipher. Throw away your UUIDs!

    I've been too lazy to do a writeup about it but I wrote a Ruby gem to address this problem of hiding sequential primary keys that uses a Feistel network to effectively shuffle int64 IDs: https://github.com/abevoelker/gfc64

    So instead of

        /customers/1

  • sqids-cpp

    Official C++ port of Sqids. Generate short unique IDs from numbers.

  • compiler-explorer

    Run compilers interactively from your web browser and interact with the assembly

    Well if you don't filter, things like this may happen:

    https://github.com/compiler-explorer/compiler-explorer/issue...

    Me and you will know it's just random characters, but if HR enters the chat...

  • FriendlyId

    FriendlyId is the “Swiss Army bulldozer” of slugging and permalink plugins for ActiveRecord. It allows you to create pretty URL’s and work with human-friendly strings as if they were numeric ids for ActiveRecord models.

    On a side note, "Sqids ... is an open-source library that lets you generate YouTube-looking IDs from numbers.", "The main use of Sqids is purely visual."

    If the purpose of it is to give a friendlier url / id, who not use something like friendly_id instead? (http://norman.github.io/friendly_id).

    The url is readable and searchable through the history.

    I would much rather prefer people using "www.website.com/channel/video/a-dog-walking" instead of "www.website.com/channel/video/3cXv8c".

  • sqids-blocklist

    Words that we do not want to appear in Sqids IDs

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Designing a Website Without 404s

    1 project | news.ycombinator.com | 13 Jun 2024
  • How to ensure params are correct in URL after deleting a record?

    1 project | /r/rails | 20 Feb 2023
  • Natalie: A unique Ruby implementation, compiled to C++ (WIP)

    1 project | news.ycombinator.com | 6 Jun 2022
  • Natalie: a unique Ruby implementation, compiled to C++ (WIP)

    1 project | /r/ruby | 6 Jun 2022
  • replacing id with slug in routes.rb

    1 project | /r/rails | 12 Feb 2022

Did you konow that Ruby is
the 12th most popular programming language
based on number of metions?