Glyph11.Native 0.1.0

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

Glyph11.Native

Native (P/Invoke) binding for Glyph11 — a zero-allocation, hardened HTTP/1.1 request parser. This package wraps the C core (libglyph11) and bundles the native binary for every supported platform, so a plain <PackageReference> works with no extra setup:

OS RIDs
Linux linux-x64, linux-arm64
Windows win-x64, win-arm64
macOS osx-x64, osx-arm64

The right binary is resolved from runtimes/<rid>/native/ automatically at build/publish.

linux-x64 requires AVX2 (a 2013+ "Haswell" or newer CPU — universal on modern servers and cloud). It's built at the x86-64-v3 microarchitecture level so the SIMD scanners inline into the parse loop (~15% faster on large headers). All other RIDs use the portable baseline.

Looking for the dependency-free, pure-managed parser? Use the Glyph11 package instead. This one trades portability for the native core (and a per-platform binary).

Install

dotnet add package Glyph11.Native

Parse a request

using Glyph11.Native;

var request = "GET /api/users?a=1 HTTP/1.1\r\nHost: example.com\r\n\r\n"u8.ToArray();
var headers = new Glyph11Field[64];
var query   = new Glyph11Field[16];

int status = Glyph11Parser.Parse(request, headers, query, Glyph11Limits.Default, out Glyph11Result result);
// status 0 == OK. result.HeaderCount / .Consumed; every span (result.Path,
// headers[i].Name, ...) is an Offset/Length into `request` — zero-copy.

Decode a chunked body

A streaming decoder — feed each network read; it strips the chunk framing and writes the decoded payload into your buffer, carrying partial-chunk state across calls (one call per read, not per chunk, no allocation):

Glyph11Chunked.Init(out var decoder);
var result = Glyph11Chunked.Decode(ref decoder, input, output, out int inConsumed, out int outWritten);
// result: Ok (need more input) | Done (terminal chunk seen) | Error (malformed framing)

Notes

  • Zero-allocation: the parser writes into caller-provided arrays/spans; the C core takes a single contiguous slab. Multi-segment input must be linearized by the caller first.
  • GLYPH11_NATIVE_PATH overrides native resolution with an explicit path to libglyph11.{so,dll,dylib} — handy for tests and benchmarks against a fresh local build.

MIT licensed. Source and issues: https://github.com/MDA2AV/Glyph11.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

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
0.1.0 46 6/17/2026