sqids-javascript VS gfc64

Compare sqids-javascript vs gfc64 and see what are their differences.

sqids-javascript

Official JavaScript port of Sqids. Generate short unique IDs from numbers. (by sqids)

gfc64

Obscures database sequential primary keys (or any 64-bit int) using a Feistel cipher. Throw away your UUIDs! (by abevoelker)
SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
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.
www.influxdata.com
featured
sqids-javascript gfc64
1 2
557 10
7.4% -
7.1 6.9
3 months ago 7 months ago
TypeScript Ruby
MIT License -
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

sqids-javascript

Posts with mentions or reviews of sqids-javascript. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-11-25.
  • Sqids – Generate Short Unique IDs from Numbers
    13 projects | news.ycombinator.com | 25 Nov 2023
    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...

gfc64

Posts with mentions or reviews of gfc64. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-17.
  • My Notes on Gitlab's Postgres Schema Design (2022)
    3 projects | news.ycombinator.com | 17 Feb 2024
    The point about the storage size of UUID columns is unconvincing. 128 bits vs. 64 bits doesn't matter much when the table has five other columns.

    A much more salient concern for me is performance. UUIDv4 is widely supported but is completely random, which is not ideal for index performance. UUIDv7[0] is closer to Snowflake[1] and has some temporal locality but is less widely implemented.

    There's an orthogonal approach which is using bigserial and encrypting the keys: https://github.com/abevoelker/gfc64

    But this means 1) you can't rotate the secret and 2) if it's ever leaked everyone can now Fermi-estimate your table sizes.

    Having separate public and internal IDs seems both tedious and sacrifices performance (if the public-facing ID is a UUIDv4).

    I think UUIDv7 is the solution that checks the most boxes.

    [0]: https://uuid7.com/

    [1]: https://en.wikipedia.org/wiki/Snowflake_ID

  • Sqids – Generate Short Unique IDs from Numbers
    13 projects | news.ycombinator.com | 25 Nov 2023
    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

What are some alternatives?

When comparing sqids-javascript and gfc64 you can also consider the following projects:

nanoid-dictionary - Predefined character sets to use with nanoid

nanoid-good - Obscene words filter for nanoid

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

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.

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

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