Glyph11.Native
0.1.0
dotnet add package Glyph11.Native --version 0.1.0
NuGet\Install-Package Glyph11.Native -Version 0.1.0
<PackageReference Include="Glyph11.Native" Version="0.1.0" />
<PackageVersion Include="Glyph11.Native" Version="0.1.0" />
<PackageReference Include="Glyph11.Native" />
paket add Glyph11.Native --version 0.1.0
#r "nuget: Glyph11.Native, 0.1.0"
#:package Glyph11.Native@0.1.0
#addin nuget:?package=Glyph11.Native&version=0.1.0
#tool nuget:?package=Glyph11.Native&version=0.1.0
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-x64requires AVX2 (a 2013+ "Haswell" or newer CPU — universal on modern servers and cloud). It's built at thex86-64-v3microarchitecture 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
Glyph11package 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_PATHoverrides native resolution with an explicit path tolibglyph11.{so,dll,dylib}— handy for tests and benchmarks against a fresh local build.
MIT licensed. Source and issues: https://github.com/MDA2AV/Glyph11.
| Product | Versions 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. |
-
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 |