CodeLogic.Common 4.6.69-preview

This is a prerelease version of CodeLogic.Common.
This package has a SemVer 2.0.0 package version: 4.6.69-preview+38521e3.
There is a newer version of this package available.
See the version list below for details.
dotnet add package CodeLogic.Common --version 4.6.69-preview
                    
NuGet\Install-Package CodeLogic.Common -Version 4.6.69-preview
                    
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.69-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeLogic.Common" Version="4.6.69-preview" />
                    
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.69-preview
                    
#r "nuget: CodeLogic.Common, 4.6.69-preview"
                    
#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.69-preview
                    
#: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.69-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CodeLogic.Common&version=4.6.69-preview&prerelease
                    
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

  • Security — Hashing (SHA-256/512, PBKDF2 password hash/verify, HMAC) and Encryption (AES-256-GCM for strings and bytes, key generation).
  • Generators — IdGenerator (GUID, sequential, timestamp, NanoID, URL-safe, sortable) and PasswordGenerator (passwords, passphrases, PINs, strength estimation).
  • Data & JSON — JsonHelper serialize/deserialize, file I/O, validation, merge, property extraction.
  • Conversion — TypeConverter safe Result-based conversion to int/long/double/bool/decimal/DateTime/Guid/enum.
  • Compression — CompressionHelper GZip, Brotli, and LZ4 for bytes, plus GZip-to-Base64 string helpers.
  • Strings — StringHelper (truncate, slug, case conversion, HTML strip) and StringValidator (email/URL/phone/IP/GUID checks).
  • Time — DateTimeHelper Unix timestamps, ISO 8601, age, business days, boundaries, relative strings.
  • Web — HtmlHelper, HttpClientHelper, HttpHeaderHelper, UrlHelper for HTML sanitization, typed HTTP requests, header/IP/UA parsing, and URL building.
  • Networking — NetworkPing, NetworkDns, SubnetCalculator, TraceRoute.
  • Parser / Cron — CronParser parse/validate 5-field cron and compute the next UTC occurrence.
  • Imaging — CLU_Imaging resize, crop, format conversion (JPEG/PNG/WebP), thumbnails, dimensions, Base64 — via SkiaSharp.
  • Caching — ICache / MemoryCache async typed in-process cache with per-entry TTL.
  • File handling — FileSystem async read/write/copy/move/delete, directory create, listing, size, existence.
  • Reflection — AssemblyHelper 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 (1)

Showing the top 1 NuGet packages that depend on CodeLogic.Common:

Package Downloads
CodeLogic.Data

Provider-neutral database framework (ORM) for CodeLogic 5 applications: typed LINQ queries, repositories, schema sync, migrations, caching, replicas and telemetry. Install a provider package (CodeLogic.Data.MySql, .PostgreSql, .SqlServer or .Sqlite) next to it.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.116-preview 68 11/1/2026
5.0.115-preview 123 11/1/2026
5.0.114-preview 60 10/31/2026
5.0.113-preview 59 10/31/2026
4.9.104 54 10/27/2026
4.9.103 40 10/27/2026
4.9.98 47 10/25/2026
4.8.93 76 9/23/2026
4.8.87 109 9/13/2026
4.8.85 68 9/12/2026
4.6.72 247 6/20/2026
4.6.69-preview 67 6/20/2026
4.5.2 134 5/24/2026
4.5.2-preview.68 98 6/20/2026
4.5.1 190 5/24/2026
4.5.1-preview.56 125 5/24/2026
4.4.2-preview.53 89 5/24/2026
4.4.1 149 5/24/2026
4.0.5 133 5/15/2026
4.0.4 134 5/9/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).