Nalix.Codec 13.0.0

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

Nalix.Codec

High-performance data transformation and framing engine.

Nalix.Codec provides the unified pipeline for data handling in Nalix. It orchestrates serialization, LZ4 compression, AEAD cryptography, and protocol framing into a cohesive, high-throughput transform chain.

Core Features

Feature Description
🛡️ Security Engine Hardened AEAD cryptography (Chacha20Poly1305, Salsa20Poly1305) and secure X25519 handshake.
📦 Packet System Highly optimized PacketBase<TPacket> and FrameBase primitives with integrated buffer pooling.
🗜️ Compression High-speed, zero-allocation custom pool-backed LZ4 block compression.
⛓️ Frame Pipeline Multi-layered orchestrated transformation pipelines (e.g., Serialize → Compress → Encrypt).

Key Namespaces

Namespace Purpose Key Types
Nalix.Codec.DataFrames High-performance data framing and runtime packet registry PacketBase<TPacket>, FrameBase, PacketRegistry, PacketSchema
Nalix.Codec.ProtocolFrames Specialized low-level framing for control, directives, handshakes, and key exchanges Control, Directive, Handshake, KeyExchange, SessionResume
Nalix.Codec.Transforms Orchestrated pipelines and transformers sequencing compression and encryption FrameTransformer, FramePipeline, FrameCompression, FrameCipher
Nalix.Codec.Serialization Zero-allocation source-generated binary serialization and formatters LiteSerializer, FormatterProvider, IFormatter<T>, IFillableFormatter<T>
Nalix.Codec.Security Cryptographic algorithms, envelope ciphers, and key exchange layers HandshakeX25519, EnvelopeCipher
Nalix.Codec.Security.Symmetric Optimized C# stream cipher implementations ChaCha20, Salsa20
Nalix.Codec.Security.Hashing Custom high-performance hash functions, message authenticators, and PBKDF2 Poly1305, Keccak256, Pbkdf2, HmacKeccak256
Nalix.Codec.LZ4 & .Engine High-performance stream/block compression and encoder pools LZ4BlockEncoder, LZ4Codec, LZ4Encoder, LZ4Decoder, LZ4HashTablePool
Nalix.Codec.Pooling Scoped allocation lifecycle guards and factories PacketScope, PacketFactory

Installation

dotnet add package Nalix.Codec

Quick Example: Packet Definition

using Nalix.Abstractions.Networking.Packets;
using Nalix.Abstractions.Serialization;
using Nalix.Codec.DataFrames;

[Packet]
[GenerateFormatter]
[SerializePackable(SerializeLayout.Explicit)]
public partial class MyPacket : PacketBase<MyPacket>
{
    [SerializeOrder(0)] 
    public string Message { get; set; } = string.Empty;

    public MyPacket()
    {
        this.OpCode = 101; // Assign custom opcode
    }
}

Quick Example: Using LiteSerializer

using System;
using Nalix.Codec.Serialization;

// Create a custom serializable packet instance
MyPacket packet = new MyPacket { Message = "Hello Nalix!" };

// Serialize the packet into a byte array
byte[] encoded = LiteSerializer.Serialize(packet);

// Deserialize the byte array back to the packet type
MyPacket decoded = LiteSerializer.Deserialize<MyPacket>(encoded, out int bytesRead);

Console.WriteLine($"Decoded Message: {decoded.Message} (Read {bytesRead} bytes)");

Performance Principles

  • Zero-Allocation: All hot paths use Span<byte> and pooled buffers.
  • No Reflection: Serialization is handled via compile-time source generation.
  • Memory Efficient: Uses BufferLease and reference counting for large data payloads.

Documentation

For technical details on the transform pipeline and packet schema, see the Codec API Reference.

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

Showing the top 3 NuGet packages that depend on Nalix.Codec:

Package Downloads
Nalix.SDK

Nalix.SDK provides the client-side development kit for the Nalix ecosystem, offering high-level APIs, transport sessions (TCP, UDP, and WebSockets), time synchronization helpers, and typed message subscription models for building distributed applications. It acts as the bridge between application logic and the Nalix.Network layer, simplifying remote communication, configuration, and message orchestration through clean, extensible, and developer-friendly interfaces.

Nalix.Runtime

Nalix.Runtime provides the core packet processing and middleware infrastructure for the Nalix ecosystem. It includes the middleware pipeline orchestration, packet dispatching channels, and execution management needed to handle message-oriented traffic with high efficiency and low latency. It serves as the foundation for building complex message-processing workflows, offering a modular and extensible architecture that decouples transport logic from application-level packet handling.

Nalix.Hosting

Nalix.Hosting provides Microsoft-style host and builder APIs for the Nalix ecosystem. It wires configuration loading, diagnostic event bridging, packet dispatch, and TCP/UDP listener lifecycle into a familiar builder/build/start workflow for quickly bootstrapping Nalix-based servers.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
13.0.0 37 6/6/2026
12.6.0 152 5/26/2026
12.5.1 149 5/24/2026
12.5.0 137 5/23/2026
12.4.1 122 5/17/2026
12.4.0 118 5/17/2026
12.3.0 128 5/15/2026
12.2.5 138 5/14/2026
12.2.4 147 5/8/2026
12.2.1 126 5/4/2026
12.2.0 138 5/4/2026

- Pipeline-Oriented Architecture: Unified Serialization, Compression, and Security into a cohesive Codec stack.
- High-Performance Framing: Integrated DataFrames (PacketBase, FrameBase) and structured ProtocolFrames for unified control and data transport.
- Advanced Cryptography: Hardened AEAD engines (Chacha20Poly1305/Salsa20Poly1305) and high-speed X25519 key exchange.
- Optimized Serialization: Refined LiteSerializer with source-generated codecs for complex types and fast unmanaged paths.
- Efficient Compression: Integrated LZ4 block encoders with custom memory pool support to minimize GC pressure.