Sqids
Dosaic.Extensions.Sqids is an extension library that provides methods to convert strings to and from Sqid format using the Sqids library.
Installation
To install the nuget package follow these steps:
or add as package reference to your .csproj
Usage
The extension provides simple methods to convert strings to and from Sqid format.
Basic Conversion
Convert a string to a Sqid:
Convert a Sqid back to the original string:
Custom Encoder
You can also use a custom encoder for special use cases:
Default Configuration
By default, the extension uses the following configuration:
Alphabet: "kKsW7PVdXUYnHgQ6rujl0GepfNzB2qZ9bC83IyDmOAtJ4hcSvM1Roaw5LxEiTF"
Minimum Length: 10
You can modify the default encoder if needed:
Use Cases
Sqids are useful for:
Creating URL-friendly identifiers
Obfuscating sequential IDs
Generating short, unique string identifiers
Last updated