Sqids – Generate Short Unique IDs from Numbers

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

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • 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.

  • proquint

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

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • 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-...

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS 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

    Sqids library to generate the default blocklist that will be used to test auto-generated 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