The official .NET port of Sqids
Sqids (pronounced "squids") is a small library that lets you generate YouTube-like IDs from numbers. It turns numbers like 127
into strings like yc3
, which you can then decode back into the original numbers. Sqids is useful for when you want to hide numbers (like sequential numeric IDs) into random-looking strings to be used in URLs and elsewhere.
using Sqids;
var sqids = new SqidsEncoder<int>();
var id = sqids.Encode(1, 2, 3); // "86Rf07"
var numbers = sqids.Decode(id); // [1, 2, 3]
Note: For the full documentation and other examples, check out the GitHub repository.