Sqiddler 0.0.4

dotnet add package Sqiddler --version 0.0.4
                    
NuGet\Install-Package Sqiddler -Version 0.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sqiddler" Version="0.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sqiddler" Version="0.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Sqiddler" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sqiddler --version 0.0.4
                    
#r "nuget: Sqiddler, 0.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Sqiddler@0.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Sqiddler&version=0.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Sqiddler&version=0.0.4
                    
Install as a Cake Tool

Sqiddler

Nuget License GitHub

Sqiddler applies Sqids to serialize integer ids to obfuscated strings. It uses ASP.NET Core's built-in JSON serialization and model binding features to automatically convert between integers and Sqid-strings. It also shuffles the alphabet by entity to make it harder to mix ids.

Getting Started

Install NuGet package Sqiddler

dotnet add package Sqiddler

Annotate your id properties with [JsonSqid<TEntity>] and id route parameters with SqidParam<TEntity> to serialize them to Sqid-strings.

public class Person
{
  public int Id { get; set; }
}

public class PersonDto
{
  // Id gets serialized to Sqid-string
  [JsonSqid<Person>]
  public int Id { get; set; }

  public string OtherProperty { get; set; }
}

public class PersonEndpoints
{
  public void Map(WebApplication app)
  {
    app.MapGet("person/{id}", GetPerson);
  }

  public static async Task<Ok<MyDto>> GetPerson(ISender sender, SqidParam<Person> id)
  {
    return Task.FromResult(new PersonDto()
    {
      Id = 42,
      OtherProperty = "Hello, World!"
    }
  }
}

Configuration

Configure Sqids in Program.cs

var builder = WebApplication.CreateBuilder(args);

// configure SqidsOptions from appsettings.json
builder.Configuration.GetSection("Sqids").Bind(SqidsOptionsFactory.Default);

// optimize SqidsOptions.MinLength for TEntity
SqidsOptionsFactory.Configure<Person>(4); // enough for 100_000

var app = builder.Build();
app.Run();

Configure Sqids.SqidsOptions in appsettings.json

"Sqids": {
  // generated from https://sqids.org/playground
  "Alphabet": "kBZDsjNeIWrQUSqExvwgdcnyl05X2F7f3pYVO9MaRhtLoP8GbiuzCm1T6KAJH4"
}

Open API

Install NuGet package Sqiddler.OpenApi instead of Sqiddler

dotnet add package Sqiddler.OpenApi

Register Open API in Program.cs

var builder = WebApplication.CreateBuilder(args);
services.AddOpenApi(options =>
{
  // reflect Sqid-string changes in Open API
  options.AddSqids(options);
});
var app = builder.Build();
app.MapOpenApi();
app.Run();
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Sqiddler:

Package Downloads
Sqiddler.OpenApi

Use Sqids in ASP.NET Core with Attributes

Sqiddler.NSwag

Use Sqids in ASP.NET Core with Attributes

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.4 515 11/25/2025
0.0.3 489 10/21/2025
0.0.2 507 10/2/2025
0.0.1 485 10/2/2025