Tharga.Toolkit
1.15.20
dotnet add package Tharga.Toolkit --version 1.15.20
NuGet\Install-Package Tharga.Toolkit -Version 1.15.20
<PackageReference Include="Tharga.Toolkit" Version="1.15.20" />
<PackageVersion Include="Tharga.Toolkit" Version="1.15.20" />
<PackageReference Include="Tharga.Toolkit" />
paket add Tharga.Toolkit --version 1.15.20
#r "nuget: Tharga.Toolkit, 1.15.20"
#:package Tharga.Toolkit@1.15.20
#addin nuget:?package=Tharga.Toolkit&version=1.15.20
#tool nuget:?package=Tharga.Toolkit&version=1.15.20
Tharga.Toolkit
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);
| Product | Versions 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
- Tharga.Toolkit.Standard (>= 1.15.20)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
- Tharga.Toolkit.Standard (>= 1.15.20)
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
- Tharga.Toolkit.Standard (>= 1.15.20)
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 |