![]() |
VOOZH | about |
dotnet add package Tharga.Toolkit --version 1.15.25
NuGet\Install-Package Tharga.Toolkit -Version 1.15.25
<PackageReference Include="Tharga.Toolkit" Version="1.15.25" />
<PackageVersion Include="Tharga.Toolkit" Version="1.15.25" />Directory.Packages.props
<PackageReference Include="Tharga.Toolkit" />Project file
paket add Tharga.Toolkit --version 1.15.25
#r "nuget: Tharga.Toolkit, 1.15.25"
#:package Tharga.Toolkit@1.15.25
#addin nuget:?package=Tharga.Toolkit&version=1.15.25Install as a Cake Addin
#tool nuget:?package=Tharga.Toolkit&version=1.15.25Install as a Cake Tool
Modern .NET toolkit (net8.0+) with hashing, claims, API keys, and more. Includes all features from .
dotnet add package Tharga.Toolkit
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);
RFC 4648 Base32 encoding and decoding.
var encoded = Base32Encoding.Encode(Encoding.UTF8.GetBytes("hello"));
var decoded = Base32Encoding.Decode(encoded);
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();
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"]
// Pick a random element from an async stream
var item = await asyncEnumerable.TakeRandomAsync();
// Shuffle an async stream
await foreach (var x in asyncEnumerable.RandomOrderAsync())
{
// ...
}
Build, encrypt, and verify API keys with dependency injection support.
// Register in DI with code-based options
services.RegisterApiKeyService(options =>
{
options.SaltSize = 32;
options.Iterations = 20000;
});
// Or bind options from IConfiguration (default section name: "ApiKey")
services.RegisterApiKeyService(configuration);
services.RegisterApiKeyService(configuration, "MyApiKeySection");
// Use via IApiKeyService
var apiKey = apiKeyService.BuildApiKey("username");
var encrypted = apiKeyService.Encrypt(apiKey);
bool valid = apiKeyService.Verify(apiKey, encrypted);
var username = apiKeyService.GetUsername(apiKey);
Example appsettings.json:
{
"ApiKey": {
"SaltSize": 32,
"HashSize": 32,
"Iterations": 20000
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 3 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. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.15.25 | 306 | 6/8/2026 |
| 1.15.24 | 1,375 | 5/14/2026 |
| 1.15.23 | 1,311 | 4/28/2026 |
| 1.15.22 | 107 | 4/28/2026 |
| 1.15.21 | 742 | 4/16/2026 |
| 1.15.20 | 406 | 4/5/2026 |
| 1.15.19 | 608 | 3/25/2026 |
| 1.15.18 | 933 | 1/31/2026 |
| 1.15.16 | 332 | 12/28/2025 |
| 1.15.14 | 216 | 12/20/2025 |
| 1.15.12 | 840 | 12/1/2025 |
| 1.15.10 | 623 | 12/1/2025 |
| 1.15.8 | 529 | 11/30/2025 |
| 1.15.6 | 259 | 11/25/2025 |
| 1.15.4 | 235 | 11/25/2025 |
| 1.15.2 | 1,315 | 11/11/2025 |
| 1.14.3 | 231 | 11/1/2025 |
| 1.13.24 | 288 | 10/31/2025 |
| 1.13.22 | 394 | 10/27/2025 |