CodeLogic.Common 4.6.72

This package has a SemVer 2.0.0 package version: 4.6.72+5b7568e.
dotnet add package CodeLogic.Common --version 4.6.72
                    
NuGet\Install-Package CodeLogic.Common -Version 4.6.72
                    
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="CodeLogic.Common" Version="4.6.72" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeLogic.Common" Version="4.6.72" />
                    
Directory.Packages.props
<PackageReference Include="CodeLogic.Common" />
                    
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 CodeLogic.Common --version 4.6.72
                    
#r "nuget: CodeLogic.Common, 4.6.72"
                    
#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 CodeLogic.Common@4.6.72
                    
#: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=CodeLogic.Common&version=4.6.72
                    
Install as a Cake Addin
#tool nuget:?package=CodeLogic.Common&version=4.6.72
                    
Install as a Cake Tool

CodeLogic.Common

NuGet License: MIT

A broad, stateless utility toolkit for CodeLogic 4 — security, ID/password generation, JSON, compression, imaging, strings, time, web, networking, caching, file handling, and reflection.

CodeLogic.Common is a grab-bag of small, dependency-light helpers used across CodeLogic applications. Almost everything is exposed as static helper classes grouped by namespace, so you call them directly — Hashing.Sha256(...), IdGenerator.NanoId(), JsonHelper.Serialize(...) — with no library instance to wire up. Many fallible operations return a framework Result / Result<T> instead of throwing, while simple helpers return plain values (string, bool, byte[]). The package also ships a CommonLibrary (ILibrary) so it participates in the CodeLogic lifecycle and health system.

Install

dotnet add package CodeLogic.Common

Quick start

The static helpers need no setup — import a namespace and call:

using CL.Common.Security;
using CL.Common.Generators;
using CL.Common.Data;

// Hashing — plain string return (lowercase hex)
string digest = Hashing.Sha256("my-secret-data");

// AES-256-GCM authenticated encryption — tampering is detected on decrypt
string cipher = Encryption.EncryptAes("top secret", "passphrase");
string plain  = Encryption.DecryptAes(cipher, "passphrase");

// A URL-safe, collision-resistant id — plain string return
string id = IdGenerator.NanoId();   // e.g. "V1StGXR8_Z5jdHi6B-myT"

// JSON — Result-based (never throws)
Result<string> json = JsonHelper.Serialize(new { name = "Ada" });   // {"name":"Ada"}

To participate in the CodeLogic lifecycle and health checks, load the library as usual — the static helpers remain available either way:

using CL.Common;

await Libraries.LoadAsync<CommonLibrary>();   // register before ConfigureAsync()
await CodeLogic.ConfigureAsync();
await CodeLogic.StartAsync();

Features

  • SecurityHashing (SHA-256/512, PBKDF2 password hash/verify, HMAC) and Encryption (AES-256-GCM for strings and bytes, key generation).
  • GeneratorsIdGenerator (GUID, sequential, timestamp, NanoID, URL-safe, sortable) and PasswordGenerator (passwords, passphrases, PINs, strength estimation).
  • Data & JSONJsonHelper serialize/deserialize, file I/O, validation, merge, property extraction.
  • ConversionTypeConverter safe Result-based conversion to int/long/double/bool/decimal/DateTime/Guid/enum.
  • CompressionCompressionHelper GZip, Brotli, and LZ4 for bytes, plus GZip-to-Base64 string helpers.
  • StringsStringHelper (truncate, slug, case conversion, HTML strip) and StringValidator (email/URL/phone/IP/GUID checks).
  • TimeDateTimeHelper Unix timestamps, ISO 8601, age, business days, boundaries, relative strings.
  • WebHtmlHelper, HttpClientHelper, HttpHeaderHelper, UrlHelper for HTML sanitization, typed HTTP requests, header/IP/UA parsing, and URL building.
  • NetworkingNetworkPing, NetworkDns, SubnetCalculator, TraceRoute.
  • Parser / CronCronParser parse/validate 5-field cron and compute the next UTC occurrence.
  • ImagingCLU_Imaging resize, crop, format conversion (JPEG/PNG/WebP), thumbnails, dimensions, Base64 — via SkiaSharp.
  • CachingICache / MemoryCache async typed in-process cache with per-entry TTL.
  • File handlingFileSystem async read/write/copy/move/delete, directory create, listing, size, existence.
  • ReflectionAssemblyHelper and ReflectionHelper for assembly metadata, type discovery, embedded resources, and dynamic property/method access.

Documentation

Full guide: CL.Common documentation

Requirements

  • No configuration required — CL.Common is a stateless utility library and writes no config file.
  • CodeLogic 4 · .NET 10
  • SkiaSharp 3.x (imaging) · K4os.Compression.LZ4 1.x (LZ4) · Newtonsoft.Json 13.x

License

MIT — see LICENSE.

Product Compatible and additional computed target framework versions.
.NET 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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.6.72 180 6/20/2026
4.6.69-preview 32 6/20/2026
4.5.2 103 5/24/2026
4.5.2-preview.68 58 6/20/2026
4.5.1 157 5/24/2026
4.5.1-preview.56 91 5/24/2026
4.4.2-preview.53 57 5/24/2026
4.4.1 112 5/24/2026
4.0.5 102 5/15/2026
4.0.4 103 5/9/2026
4.0.3 102 5/9/2026
3.2.12 808 4/18/2026
3.2.11 116 4/18/2026
3.2.10 104 4/18/2026
3.2.9 104 4/18/2026
3.2.8 100 4/18/2026
3.2.7 104 4/18/2026
3.2.6 103 4/18/2026
3.2.5 109 4/18/2026
3.2.4 106 4/17/2026
Loading failed

# CL.Common — Changelog

All notable changes to **CodeLogic.Common** are documented here. Versions follow
[Semantic Versioning](https://semver.org/).

## 2026-06-20

### Documentation

- Full rewrite of the README and docs to house style. The README is now concise
 Markdown-only (renders on both GitHub and NuGet): install, quick start showing the
 static helpers and the optional `CommonLibrary` load, a grouped feature list, and a
 link to the docs site. Notes that `CL.Common` is stateless and needs no configuration.
- Expanded the documentation site into a three-page set under `docs/libs/common/`:
 an **Overview** (toolkit map, how static helpers are organized by namespace, the full
 catalog table, health check), **Security & Data** (`Encryption`, `Hashing`,
 `IdGenerator`, `PasswordGenerator`/`PasswordStrength`, `JsonHelper`, `TypeConverter`,
 `CompressionHelper`), and **Utilities** (`StringHelper`/`StringValidator`,
 `DateTimeHelper`, the web helpers, the networking set, `CronParser`, `CLU_Imaging`,
 `ICache`/`MemoryCache`, `FileSystem`, and the reflection helpers). Each page documents
 per-member return types accurately — plain values vs. `Result`/`Result<T>`. No API changes.

## [4.5.2] — 2026-06-20

### Documentation

- Documented the full public surface of the toolkit in the README. Previously only
 imaging, hashing, caching, file handling, compression, and networking were listed;
 the README now also covers **Security** (`Encryption` AES-256-GCM and the `Hashing`
 PBKDF2/HMAC helpers), **Generators** (`IdGenerator`, `PasswordGenerator`),
 **Data** (`JsonHelper`), **Conversion** (`TypeConverter`), **Parser** (`CronParser`),
 **Time** (`DateTimeHelper`), **Strings** (`StringHelper`, `StringValidator`),
 **Web** (`UrlHelper`, `HtmlHelper`, `HttpClientHelper`, `HttpHeaderHelper`),
 the full **Networking** set (`NetworkPing`, `NetworkDns`, `SubnetCalculator`,
 `TraceRoute`), and **Reflection** (`AssemblyHelper`, `ReflectionHelper`).
- Corrected the Quick Start hashing example: the helper is `Hashing.Sha256(...)`
 (no `CLU_Hashing.SHA256` type exists), and clarified that GZip, Brotli, and LZ4
 are all available from `CompressionHelper`. No API changes.

## [4.5.0] — 2026-05-24

### Changed

- **Unified versioning.** All CodeLogic.Libs now share a single version line
 controlled by `version.txt` in the repo root. This is a version alignment
 release — no functional changes to this library.
## [4.0.4] — 2026-04-16

### Changed

- README + manifest refresh across every CodeLogic library for the v4
 baseline. No functional changes vs 4.0.3.
- `LibraryManifest.Version` now reads from the assembly's `AssemblyVersion`
 attribute at runtime instead of a hard-coded string.

## [4.0.2] — 2026-04-09

### Changed

- Aligned with the v4 baseline across all libraries.

## [4.0.0] — 2026-04-09

Major rewrite — republished as v4.0.0 to reset the version line under the
unified v4 baseline. All public APIs refreshed.

### Notes

- Bundles cross-platform native assets transitively for libraries that need
 them (e.g. SkiaSharp for image handling).
- Earlier history is retained in the
 [git log](https://github.com/Media2A/CodeLogic.Libs/commits/main/CL.Common).