sqids-dotnet
gfc64
sqids-dotnet | gfc64 | |
---|---|---|
2 | 2 | |
681 | 10 | |
8.4% | - | |
7.5 | 6.9 | |
3 months ago | 6 months ago | |
C# | Ruby | |
MIT License | - |
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-dotnet
-
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-...
- Sqids: Hashids, improved – encode numbers into random looking strings and back
gfc64
-
My Notes on Gitlab's Postgres Schema Design (2022)
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
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?
sqids-javascript - Official JavaScript port of Sqids. Generate short unique IDs from numbers.
nanoid-good - Obscene words filter for nanoid
DotNetCore - .NET 8 Nuget Packages.
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.
Fine Code Coverage - Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
nanoid-dictionary - Predefined character sets to use with nanoid
Architecture - .NET 8, Angular 17, Clean Architecture, Clean Code, SOLID Principles, KISS Principle, DRY Principle, Fail Fast Principle, Common Closure Principle, Common Reuse Principle, Acyclic Dependencies Principle, Mediator Pattern, Result Pattern, Folder-by-Feature Structure, Separation of Concerns.
proquint - Proquints: Identifiers that are Readable, Spellable, and Pronounceable.
sqids-ruby - Official Ruby port of Sqids. Generate short unique IDs from numbers.