Tharga.Toolkit 1.15.19

There is a newer version of this package available.
See the version list below for details.
dotnet add package Tharga.Toolkit --version 1.15.19
                    
NuGet\Install-Package Tharga.Toolkit -Version 1.15.19
                    
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="Tharga.Toolkit" Version="1.15.19" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tharga.Toolkit" Version="1.15.19" />
                    
Directory.Packages.props
<PackageReference Include="Tharga.Toolkit" />
                    
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 Tharga.Toolkit --version 1.15.19
                    
#r "nuget: Tharga.Toolkit, 1.15.19"
                    
#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 Tharga.Toolkit@1.15.19
                    
#: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=Tharga.Toolkit&version=1.15.19
                    
Install as a Cake Addin
#tool nuget:?package=Tharga.Toolkit&version=1.15.19
                    
Install as a Cake Tool

Tharga.Toolkit

NuGet Nuget License

Modern .NET toolkit (net8.0+) with hashing, claims, API keys, and more. Includes all features from Tharga.Toolkit.Standard.

Installation

dotnet add package Tharga.Toolkit

Features

Hash

Compute hashes from strings, byte arrays, URIs, and streams. Supports MD5, SHA1, SHA256, SHA384, and SHA512.

// String hash
var hash = "hello".ToHash(HashType.SHA256);

// Formatted output
var hex = "hello".ToHash(HashFormat.HexLower, HashType.SHA256);

// Stream hash
await using var stream = File.OpenRead("file.dat");
var streamHash = await stream.ToHashAsync(HashFormat.Base64, HashType.SHA256);

// Change format
var base32 = hex.ChangeFormat(HashFormat.Base32);

Base32 Encoding

RFC 4648 Base32 encoding and decoding.

var encoded = Base32Encoding.Encode(Encoding.UTF8.GetBytes("hello"));
var decoded = Base32Encoding.Decode(encoded);

Claims Extensions

Extract and verify identity keys from claims principals.

// Get a portable identity key
var key = claimsPrincipal.GetKey();

// Verify against a known identity
bool match = key.VerifyKey("user-123", "sub");

// Extract all identities
var identities = key.GetIdentities();

URI Extensions

var uri = new Uri("https://example.com/path?page=1&sort=name");

// Remove query string
var clean = uri.RemoveQuery(); // https://example.com/path

// Get specific query values
var values = uri.GetQueryValue("sort"); // ["name"]

Async Enumerable Extensions

// Pick a random element from an async stream
var item = await asyncEnumerable.TakeRandomAsync();

// Shuffle an async stream
await foreach (var x in asyncEnumerable.RandomOrderAsync())
{
    // ...
}

API Key Service

Build, encrypt, and verify API keys with dependency injection support.

// Register in DI
services.RegisterApiKeyService(options =>
{
    options.SaltSize = 32;
    options.Iterations = 20000;
});

// Use via IApiKeyService
var apiKey = apiKeyService.BuildApiKey("username");
var encrypted = apiKeyService.Encrypt(apiKey);
bool valid = apiKeyService.Verify(apiKey, encrypted);
var username = apiKeyService.GetUsername(apiKey);

GitHub repo

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 (4)

Showing the top 4 NuGet packages that depend on Tharga.Toolkit:

Package Downloads
Mystik.Yggdrasil.Server

Package Description

Tharga.Blazor

Generic reusable Blazor UI components: buttons, breadcrumbs, error boundaries, and more. Built on Radzen.Blazor.

Tharga.Team

Team features for Tharga Blazor.

Tharga.Api

Reusable API-key authentication handler, controller registration, and OpenAPI/Swagger setup for ASP.NET Core projects.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.15.20 239 4/5/2026
1.15.19 448 3/25/2026
1.15.18 891 1/31/2026
1.15.16 314 12/28/2025
1.15.14 203 12/20/2025
1.15.12 823 12/1/2025
1.15.10 608 12/1/2025
1.15.8 515 11/30/2025
1.15.6 243 11/25/2025
1.15.4 224 11/25/2025
1.15.2 978 11/11/2025
1.14.3 216 11/1/2025
1.13.24 268 10/31/2025
1.13.22 381 10/27/2025
1.13.20 384 10/14/2025
1.13.18 216 10/13/2025
1.13.16 363 8/16/2025
1.13.14 422 8/5/2025
1.13.12 727 7/22/2025
Loading failed